Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Making "image buttons"

Author
Message
V Factor
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 16th Jan 2005 22:48
Hello all!

I was just faced with a challange of creating "image buttons". What I mean is, when you click on the image another screen pops up.
Any help would be gratly appriciated. Thanks.
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 17th Jan 2005 06:18
I had a beginning of a snake program that I was going submit into a competition that started up with button images, when I get to my home computer I will try to upload it up. Although the program was never finished it will give you an example of how to do it.


Click sig for DarkBASIC Network IDE.
V Factor
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 17th Jan 2005 10:18
Alright, i'll be looking forward to it. Thanks.
V Factor
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 19th Jan 2005 04:26
Ahhhh, well I guess he never got to it, but does anyone else have a solution. Doesn't necessarily have to be code, some ideas whould be nice.
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 19th Jan 2005 09:16
If you want fancy 3D "buttons", you can texture cube objects with your button bitmap and use PICK OBJECT to intercept the mouse clicks (you'll get back the object ID of the cube that was clicked on). What's fun about this is you can put several options on one cube (one button image on each face) and spin the cube so that the option you want to present faces the user.

If you want to start w/o the fancy cube rotating, you could just texture a plane object with your button graphic

Sorry I don't have sample code for you, but I've seen it done and it's not too bad. I have used PICK OBJECT in making a level editor and it's pretty easy to understand from the help in the DBP help file.

Hope that's at least a start for you....
V Factor
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 19th Jan 2005 11:23
Perfect! How did I never thought of that. Thank you very much. I appreciate it very much.
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 22nd Jan 2005 14:42 Edited at: 22nd Jan 2005 14:56
the way i have done it is to make the button(s)/image and use a sprite on the screen, where the code checks to see if the mouse is within the demensions of the button and if clicked on it switches to the next screen....



probably a cleaner way to do it, but heck im still a noob.... without 3-d........
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 22nd Jan 2005 18:13 Edited at: 22nd Jan 2005 18:21
I've got a load of functions that i use for creating buttons with images.



You will need to declare a typed array at the top of your program.



http://www.dbspot.com/NYC
New years competition... Fo Shizzle.
V Factor
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 20th Feb 2005 01:01
Thanks to all of you who bothered to reply. I have got it working, and it looks better than I have imagined. Thank you.

Login to post a reply

Server time is: 2024-11-27 22:34:38
Your offset time is: 2024-11-27 22:34:38