Jump to content

CASTORGUI.GUISpinner step size issue


Recommended Posts



I am using the excellent  CastorGUI extension but am having a small problem.


It  seems like the step size is being ignored in CASTORGUI.GUISpinner when set to 2 instead of 1.  In the code below I am creating two spinners (one for width of shed and one for length).



var WidthSpinner = function()  { shedWidth =   guiSpinnerW.value * 12;scene.dispose();scene=createScene(); };  


var LengthSpinner = function() { shedLength = guiSpinnerL.value * 12;scene.dispose();scene=createScene();  };   


var css = "button{cursor:pointer;} #textDialog{margin:6px;}";


var guisystem = new CASTORGUI.GUIManager(canvas, css);


var guiTexture = new CASTORGUI.GUITexture("life", "data/image.png", {w:50,h:50,x:100,y:3}, guisystem, null);


var guiSpinnerW = new CASTORGUI.GUISpinner(

"spinW",{value:8,stip:2,w:30,h:25,x:10,y:3,min:8,max:12}, guisystem, WidthSpinner);


var guiSpinnerL = new CASTORGUI.GUISpinner(

"spinL",{value:16,stip:2,w:30,h:25,x:50,y:3,min:8,max:40}, guisystem, LengthSpinner);



In my tests, the spinners function properly but increments by ones, not by twos as I was trying for.  I tried spelling "stip" as "step" with no evident change in behavior.    Can anyone point me to a fix here.  I looked at the source online and did not  see where the counter associated with the spinner control was being incremented.




Thanks a lot.



Link to comment
Share on other sites

Ok, is fixed. it was because of stip I renamed in step


Therefore, you must rename the stip option in step (with the new version of the deposit)


var guiSpinnerW = new CASTORGUI.GUISpinner("spinW",{value:8,step:2,w:30,h:25,x:10,y:3,min:8,max:12}, guisystem, WidthSpinner);
var guiSpinnerL = new CASTORGUI.GUISpinner("spinL",{value:16,step:2,w:30,h:25,x:50,y:3,min:8,max:40}, guisystem, LengthSpinner);
I add in passing a new class: GUIColor with documentation. (it may also be useful)
Thank you for your report.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...