Pictures as buttons
Author |
Message |
fatoman
|
Posted: Fri Sep 24, 2004 10:50 pm Post subject: Pictures as buttons |
|
|
I am quite new to Turing and I was just wondering if there was a way to either replace the default text for the buttons in the run window to something more likeable or if I could take a jpeg or gif and turn that into a button that is clickable and goes down |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Andy
|
Posted: Fri Sep 24, 2004 10:58 pm Post subject: (No subject) |
|
|
default text buttons? turing has no default buttons... read up on mousewhere in the tutorials if u wana make a button |
|
|
|
|
|
Dan
|
Posted: Sat Sep 25, 2004 12:05 am Post subject: (No subject) |
|
|
dodge_tomahawk wrote: default text buttons? turing has no default buttons...
The GUI dodge
Ya there is no way to map over the GUI buttions with a image with out recoding the GUI in turing. Your best bet is to find out how to use images in turing, colsione dection and then the mouse comands. We have tutorals on all 3. If you put them together u can make pic buttions. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Genesis
|
Posted: Sat Sep 25, 2004 12:18 am Post subject: (No subject) |
|
|
So, make pics of what you want the buttons to look like in their various states. So this includes their normal appearence, their appearence when users roll over them, and their appearence when users click on them.
Learn to import pics into Turing, there are many tutorials on this. And its quite simple.
Learn how to use Mouse.Where.
For example:
code: | var x, y, button : int
loop
Mouse.Where (x, y, button)
locate (1, 1)
put x, " ", y, " ", button
end loop |
This code displays the mouse's X and Y position as you move it around, as well as when you've clicked.
After importing you're pictures of buttons, you can use the above code to determine when a user has rolled over a button by knowing it's X and Y position, as well as the X and Y position of the cursor. When this is the case, display the picture of the roll over button in place of the original. If the user clicks, display the clicked button image in place of the roll over one.
It's really quite simple. |
|
|
|
|
|
Cervantes
|
Posted: Sat Sep 25, 2004 8:25 am Post subject: (No subject) |
|
|
I suppose it wouldn't work to have a GUI button and then draw a picture over top of the button, would it? |
|
|
|
|
|
Mazer
|
Posted: Sat Sep 25, 2004 1:57 pm Post subject: (No subject) |
|
|
Cervantes wrote: I suppose it wouldn't work to have a GUI button and then draw a picture over top of the button, would it?
I'm almost certain that your picture would be drawn over as soon as you click on the button, or whenever you call GUI.Refresh(). |
|
|
|
|
|
Cervantes
|
Posted: Sun Sep 26, 2004 7:23 am Post subject: (No subject) |
|
|
hmmm... well in that case, couldn't you just redraw the picture over top of the button each time it is clicked or un clicked or GUI.Refresh() is called? |
|
|
|
|
|
Mazer
|
Posted: Sun Sep 26, 2004 7:31 am Post subject: (No subject) |
|
|
Perhaps, but it'd be easier to just write your own GUI code in that case. Not saying to entirely rewrite the GUI library, just the buttons part that you wanted. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|