shedbuilder Posted December 10, 2015 Share Posted December 10, 2015 Hi, 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. Reference doc: https://github.com/dad72/CastorGUI/blob/master/doc/GUISpinner.md Thanks a lot. Jeff Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 10, 2015 Share Posted December 10, 2015 I will look at this evening or tomorrow. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 11, 2015 Share Posted December 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
shedbuilder Posted December 12, 2015 Author Share Posted December 12, 2015 Thanks a lot. It works perfectly now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.