turing button question
Author |
Message |
lovecompsi
|
Posted: 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
|
|
|
Tony
|
Posted: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Kharybdis
|
Posted: 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
|
Posted: 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 |
|
|
|
|
|
|
|