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

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




PostPosted: Sun Oct 19, 2003 6:56 pm   Post subject: interactive areas "buttons"

I am having a little trouble making a certain area of the screen interactive,I want to allow the user to click on certain areas of the screen and trigger certain animations etc. for example if i placed a square on the screen, the user should be able to click anywhere on that square and something will occur as a result. Does anyone know how i might go about this? I just cant seem to figure it out.
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Sun Oct 19, 2003 7:09 pm   Post subject: (No subject)

use the mouse module in turing.

code:
var x, y, btn : int

loop
    Mouse.Where (x, y, btn)
    if x < 100  and x > 0 and y < 100 and y > 0 and button = 1 then
        blah blah blah
    end if
end loop


basicly, you want to set an area that you want the user to click on, if they click within that area, then do something.
Tony




PostPosted: Sun Oct 19, 2003 9:05 pm   Post subject: (No subject)

code:

Mouse.Where (x, y, btn)


Mouse.Where is a function that assigns mouse values to the variables passed to. X/Y is the mouse's current location, while btn is button status. 1 is left click 0 is no click. There're also values for right click and clicking both at same time.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: