Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 turing buttons
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
athanasia101




PostPosted: Fri May 07, 2010 4:08 pm   Post subject: 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 Very Happy Very Happy
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Fri May 07, 2010 4:24 pm   Post subject: 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




PostPosted: Sat May 08, 2010 11:08 am   Post subject: 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:

Quote:

%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 <= 200 and y >= 100 and y <= 200 then
drawfillbox (100,100,200,200,9)
elsif button = 1 and x >= 100 and x <= 200 and y >= 100 and y <= 200 then
drawfillbox (100,100,200,200,42)
%Other events you would want to occur after you click on the button would go here!
end if
end loop


Hope that helped. Very Happy
SNIPERDUDE




PostPosted: Sat May 08, 2010 11:20 pm   Post subject: RE:turing buttons

Syntax tags keeps indentation, and makes it slightly easier to read.
code:
[syntax="turing"] code here [/syntax]
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: