0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

New Twist and Height buttons

This commit is contained in:
peteruithoven 2014-01-16 16:07:40 +01:00
parent 0b908a8f44
commit e9a2b90483
10 changed files with 52 additions and 70 deletions

Binary file not shown.

BIN
img/buttons/btnHeight.xcf Normal file

Binary file not shown.

Binary file not shown.

BIN
img/buttons/btnTwist.xcf Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@ var twistIncrement = Math.PI/1800;
var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo; var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo;
var btnSettings, btnWordArt; var btnSettings, btnWordArt;
var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate; var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate;
var btnToggleVerticalShapes, btnUpDown, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv; var btnToggleVerticalShapes, btnHeight, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv;
var buttonGroupAdd, popupWordArt; var buttonGroupAdd, popupWordArt;
var state; var state;
@ -27,29 +27,27 @@ function initButtonBehavior() {
btnPrevious = $("#btnPrevious"); btnPrevious = $("#btnPrevious");
btnNext = $("#btnNext"); btnNext = $("#btnNext");
btnSave = $("#btnSave"); btnSave = $("#btnSave");
btnWordArt = $("#btnWordArt"); buttonGroupAdd = $("#buttonGroupAdd");
btnZoom = $("#btnZoom");
btnUp = $("#btnUp");
btnDown = $("#btnDown");
btnMove = $("#btnMove");
btnTwistLeft = $("#btnTwistLeft");
btnTwistRight = $("#btnTwistRight");
btnShape = $("#btnShape"); btnShape = $("#btnShape");
btnRotate = $("#btnRotate"); btnWordArt = $("#btnWordArt");
popupWordArt = $("#popupWordArt");
popupShape = $("#popupShape");
popupMask = $("#popupMask");
logoPanel = $("#logopanel");
btnToggleEdit = $("#btnToggleEdit"); btnToggleEdit = $("#btnToggleEdit");
buttonGroupEdit = $("#buttonGroupEdit"); buttonGroupEdit = $("#buttonGroupEdit");
btnZoom = $("#btnZoom");
btnMove = $("#btnMove");
btnRotate = $("#btnRotate");
btnToggleVerticalShapes = $("#btnToggleVerticalShapes");
buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes");
btnHeight = $("#btnHeight");
btnTwist = $("#btnTwist");
btnStraight = $("#btnStraight"); btnStraight = $("#btnStraight");
btnDiv = $("#btnDiv"); btnDiv = $("#btnDiv");
btnConv = $("#btnConv"); btnConv = $("#btnConv");
btnSine = $("#btnSine"); btnSine = $("#btnSine");
btnAdd = $("#btnAdd"); btnAdd = $("#btnAdd");
btnToggleVerticalShapes = $("#btnToggleVerticalShapes");
buttonGroupAdd = $("#buttonGroupAdd");
buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes");
popupWordArt = $("#popupWordArt");
popupShape = $("#popupShape");
popupMask = $("#popupMask");
logoPanel = $("#logopanel");
logoPanel.on("onButtonClick", onLogo); logoPanel.on("onButtonClick", onLogo);
btnNew.on("onButtonClick", onBtnNew); btnNew.on("onButtonClick", onBtnNew);
@ -60,10 +58,8 @@ function initButtonBehavior() {
btnOops.on("onButtonHold", onBtnOops); btnOops.on("onButtonHold", onBtnOops);
// vertical shape buttons // vertical shape buttons
btnToggleVerticalShapes.on("onButtonClick", onBtnToggleVerticalShapes); btnToggleVerticalShapes.on("onButtonClick", onBtnToggleVerticalShapes);
btnUp.on("onButtonHold", onBtnUp); btnHeight.on("onButtonHold", onBtnHeight);
btnDown.on("onButtonHold", onBtnDown); btnTwist.on("onButtonHold", onBtnTwist);
btnTwistLeft.on("onButtonHold", onBtnTwistLeft);
btnTwistRight.on("onButtonHold", onBtnTwistRight);
btnStraight.on("onButtonClick", onBtnStraight); btnStraight.on("onButtonClick", onBtnStraight);
btnDiv.on("onButtonClick", onBtnDiv); btnDiv.on("onButtonClick", onBtnDiv);
btnConv.on("onButtonClick", onBtnConv); btnConv.on("onButtonClick", onBtnConv);
@ -142,24 +138,20 @@ function initButtonBehavior() {
var h = btnZoom.height(); var h = btnZoom.height();
var multiplier = (h/2-cursor.y)*0.003; var multiplier = (h/2-cursor.y)*0.003;
rotateShape(-multiplier); rotateShape(-multiplier);
//if (cursor.y<25) rotateShape(.1);
//else if (cursor.y>55) rotateShape(-.1);
} }
function onBtnUp(e) { function onBtnHeight(e,cursor) {
var h = btnHeight.height();
if(cursor.y < h/2) {
previewUp(true); previewUp(true);
} } else {
function onBtnDown(e) {
previewDown(true); previewDown(true);
} }
function onBtnTwistLeft(e) {
previewTwistLeft(true);
} }
function onBtnTwist(e,cursor) {
function onBtnTwistRight(e) { var h = btnTwist.height();
previewTwistRight(true); var multiplier = (cursor.y-h/2)*0.0005;
previewTwist(multiplier,true);
} }
function onBtnOops(e) { function onBtnOops(e) {
@ -313,17 +305,19 @@ function previewDown(redrawLess) {
redrawRenderedPreview(redrawLess); redrawRenderedPreview(redrawLess);
} }
function previewTwistLeft(redrawLess) { function previewTwistLeft(redrawLess) {
if (redrawLess == undefined) redrawLess = false; previewTwist(-twistIncrement,true)
// console.log("f:previewTwistLeft()");
if (rStep > -previewRotationLimit) rStep -= twistIncrement;
// redrawPreview(redrawLess);
redrawRenderedPreview(redrawLess);
setSketchModified(true);
} }
function previewTwistRight(redrawLess) { function previewTwistRight(redrawLess) {
// console.log("f:previewTwistRight()"); previewTwist(twistIncrement,true)
if (rStep < previewRotationLimit) rStep += twistIncrement; }
// redrawPreview(redrawLess); function previewTwist(increment,redrawLess) {
console.log("previewTwist: ",increment);
if (redrawLess == undefined) redrawLess = false;
rStep += increment;
if(rStep < -previewRotationLimit) rStep = -previewRotationLimit;
else if(rStep > previewRotationLimit) rStep = previewRotationLimit;
redrawRenderedPreview(redrawLess); redrawRenderedPreview(redrawLess);
setSketchModified(true); setSketchModified(true);
} }

View File

@ -161,7 +161,8 @@
}*/ }*/
.buttonGroup { .buttonGroup {
background-color: white; /*background-color: white;*/
background-color: #fff;
position: absolute; position: absolute;
border: 3px solid black; border: 3px solid black;
border-radius: 40px; border-radius: 40px;
@ -185,7 +186,7 @@
#buttonGroupVerticalShapes { #buttonGroupVerticalShapes {
top: 7px; top: 7px;
left: 8px; left: 8px;
padding-top: 20px; padding: 12px 7px 7px 9px;
width: 65px; width: 65px;
.btn { .btn {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -56,18 +56,6 @@
<canvas id="thermometerCanvas" width="90" height="120"></canvas> <canvas id="thermometerCanvas" width="90" height="120"></canvas>
</div> </div>
</div> </div>
<!-- <div id="verticalShapes">
<img class="btn btnVertical btnStraight" src="img/buttons/btnStraight.png"/>
<img class="btn btnVertical btnDiv" src="img/buttons/btnDiv.png"/>
<img class="btn btnVertical btnConv" src="img/buttons/btnConv.png"/>
<img class="btn btnVertical btnSine" src="img/buttons/btnSine.png"/>
<div><img class="verticalshape straight" src="img/vertical_shape_icons/straight.png" /></div>
<div><img class="verticalshape diverging" src="img/vertical_shape_icons/diverging.png" /></div>
<div><img class="verticalshape converging" src="img/vertical_shape_icons/converging.png" /></div>
<div><img class="verticalshape sinus" src="img/vertical_shape_icons/sinus.png" /></div>
</div> -->
<div id="btnsSettingsInfo"> <div id="btnsSettingsInfo">
<img id="btnSettings" class="btn" src="img/buttons/btnSettings.png"> <img id="btnSettings" class="btn" src="img/buttons/btnSettings.png">
<img id="btnInfo" class="btn" src="img/buttons/btnInfo.png"> <img id="btnInfo" class="btn" src="img/buttons/btnInfo.png">
@ -95,16 +83,15 @@
<div id="previewContainer"> <div id="previewContainer">
<canvas id="preview"></canvas> <canvas id="preview"></canvas>
<div id="buttonGroupVerticalShapes" class="buttonGroup"> <div id="buttonGroupVerticalShapes" class="buttonGroup">
<img id="btnTwistLeft" class="btn" src="img/buttons/btnTwistLeft.png" /> <img id="btnTwist" class="btn" src="img/buttons/btnTwist.png" />
<img id="btnTwistRight" class="btn" src="img/buttons/btnTwistRight.png" /> <img id="btnHeight" class="btn" src="img/buttons/btnHeight.png" />
<img id="btnUp" class="btn" src="img/buttons/btnUp.png" /> <div id="verticalShapes">
<img id="btnDown" class="btn" src="img/buttons/btnDown.png" />
<hr>
<img id="btnConv" class="btn" src="img/buttons/btnConv.png" /> <img id="btnConv" class="btn" src="img/buttons/btnConv.png" />
<img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" /> <img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" />
<img id="btnSine" class="btn" src="img/buttons/btnSine.png" /> <img id="btnSine" class="btn" src="img/buttons/btnSine.png" />
<img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" /> <img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" />
</div> </div>
</div>
<img id="btnToggleVerticalShapes" class="btn" src="img/buttons/btnArrowClose.png" /> <img id="btnToggleVerticalShapes" class="btn" src="img/buttons/btnArrowClose.png" />
</div> </div>