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.

3 Dimensional Chat / Damn, need help

Author
Message
Siege Delux
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Norway
Posted: 19th Mar 2003 11:00
Hey, i need some help. How do you go to a room when pressing the left mouse button on a object (image).

I need this for my menu buttons

New Game
Options
Credit
Quit

Pleas tell me????????
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Mar 2003 11:15
Well, I tend to stick to a grid, like have the text size the same on each line. This little piece of code would make a quick and simple menu (with hyperlink style highlighting) - although not great coding practice, it shows the technique. For more complex menus with different options, you'd be better making a neater system, perhaps store the menu data in an array, I've used arrays to store drop down lists and menus before, and for GUI intensive stuff it's a god send.


cls
sync on

do

mx=mousex()
my=mousey()

sel=0
ink rgb(255,255,255),0
if mx>100 and mx<400 and my>100 and my<119 then sel=1 : ink rgb(255,0,0),0 else ink rgb(255,255,255),0
text 100,100,"New Game"
if mx>100 and mx<400 and my>120 and my<139 then sel=2 : ink rgb(255,0,0),0 else ink rgb(255,255,255),0
text 100,120,"Options"
if mx>100 and mx<400 and my>140 and my<159 then sel=3 : ink rgb(255,0,0),0 else ink rgb(255,255,255),0
text 100,140,"Continue Game"
if mx>100 and mx<400 and my>160 and my<179 then sel=4 : ink rgb(255,0,0),0 else ink rgb(255,255,255),0
text 100,160,"Quit"

if mouseclick()=1 and sel>0
if sel=1 then gosub newgame
`etc, add a line for each sel value
endif

sync
loop

Hope none of this get's smiliefied, Code tag isn't working .


Van-B
Siege Delux
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Norway
Posted: 22nd Mar 2003 01:53
Tanx for the help van-b, this will be handy using in my game.

Login to post a reply

Server time is: 2024-03-29 11:48:47
Your offset time is: 2024-03-29 11:48:47