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.

Author
Message
Kjetil
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Norway
Posted: 5th Mar 2003 09:22
How do I make a simple 2d menu using images or sprites.

I just end up with endless of if-endif's to check if the mouse is over the sprite.

I get it to working, but is so many much coding.
- Kjetil
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 5th Mar 2003 14:05
Well get used to it. Big projects are a lot more than 10 lines of code. Make a function for that mouse over, that would always make it shorter. Other than that, there isnt too much you can do.

Big games, have long code. If your really dedicated to this, you wont care how long it is. Think about how cool it will look when its done, and think about showing off all that code to all your friends so they can think WOW.......

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Kjetil
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Norway
Posted: 5th Mar 2003 14:15
yeah, it isn't exactly a problem, but I know there is an easier way using arrays. I just cant figure it out. I know I'v seen an example of it here somewhere, just can't find back to it.

The way I do it now is the long way. Chech the image width, check the screen width, check if mouse x > screen width/2 - image width/2,check if mouse x > screen width/2 + image width/2 ......and so it goes on.

If I just could see an example of a 2d menu using images. I guess I could figure out how to build one myself.

- Kjetil
Zach
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: Ms, USA
Posted: 5th Mar 2003 18:58
if want an already made 2d menu to see how you do it just e-mail me...znatm1@cs.com

Tupelo, Ms
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 5th Mar 2003 21:12
I tend to do it using arrays to store the width and height and the x and y positions of the button, like this...



Yum! Yum! Yum! Yum!
KamaKase
21
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 5th Mar 2003 21:58
If you make it a regular menu (ie sections are equal sized)I usually use a lengthy equation to make a variable 1-number of segments.

Login to post a reply

Server time is: 2024-09-19 22:49:13
Your offset time is: 2024-09-19 22:49:13