
-----------------------------------
athanasia101
Fri May 07, 2010 4:08 pm

turing buttons
-----------------------------------
How do you make buttons on turing. 
I need to know how to make a box or a circle and for it to be able to be clicked on by the user :D  :D

-----------------------------------
DemonWasp
Fri May 07, 2010 4:24 pm

RE:turing buttons
-----------------------------------
If you mean a traditional button object (like you see in pretty well every application ever), then you need to use GUI.CreateButton or similar. Look in the Turing help files or the Turing Tutorials section for examples.

Otherwise, you can use Mouse.Where() and your own objects (possibly a hierarchy of Shapes, such as Circle and Triangle and Rectangle objects) to determine which objects are clicked on. This is much more involved, but can be much more flexible.

-----------------------------------
hamid14
Sat May 08, 2010 11:08 am

Re: turing buttons
-----------------------------------
Turing's default GUI sucks and is the worst I have ever seen. I strongly suggest making your own buttons useing a box, oval, etc. Box is really easy with mousewhere. Have a look:


%Simple rollover button in turing
%Variables for the mouse
var x,y,button : int

%The main loop
loop
mousewhere (x,y,button)
%unclicked button
if x < 100 or x > 200 or y > 200 or y < 100 then
drawfillbox (100,100,200,200,12)
elsif x >= 100 and x = 100 and  y = 100 and x = 100 and y 