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

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




PostPosted: Thu Apr 24, 2008 8:10 pm   Post subject: turing button question

i'm doing a game program now, and i use GUI to make button now.

how can i do the program like this:

1.a picture on the button

2. when i move the mouse on it, the picture will change the other one

3. when i click it, the picture will change again

just like flash button

can anyone give me any ideas or examples about how to make it?
thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Apr 24, 2008 8:17 pm   Post subject: RE:turing button question

use Mouse.Where to figure out what's going on with the mouse (where it is and if it's clicked) and Pic.Draw to render image files.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Kharybdis




PostPosted: Fri Apr 25, 2008 10:44 am   Post subject: Re: turing button question

The noob way to do this is :

Put a picture on the screen.
Every time the mouse is located in the x1,y1,y1, and y2 of that picture, overwrite that picture with your new one.
then, if the mouse is "not" located on the locations of the picture, you change the new picture with the old one.

so only change the picture if the mouse is over it.

use mouse.where and Pic.Draw like tony said.
Tallguy




PostPosted: Mon Apr 28, 2008 8:19 am   Post subject: RE:turing button question

you'll also need if statements such as, if the mouse (mouse.where) is at x+y and the user clicks (boolean = true ) then do something
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: