Omg.. don't worry..
lets go:
sync on : sync rate 0
color backdrop 0
load image "BackGround.jpg", 1
mainMenu:
sprite 1, 0,0, 1 : size sprite 1, screen width(),screen height()
set text size 10
DO
set cursor 10,7 : print "_x: ";mousex()
set cursor 10,20: print "_y: ";mousey()
if ((mousex()=>46) and (mousex()=<240) and (mousey()=>228) and (mousey()=<260))
if (mouseClick()=1)
gosub newGame
endif
endif
sync
LOOP
newGame:
delete sprite 1
make object cube 1, 50 : color object 1, RGB(250,0,0)
position object 1, 0,0,0
position camera 0,0,-100 : point camera 0,0,0
DO
turn object right 1, 1
set cursor 0,0 : print "PRESS SPACEBAR TO GO BACK TO MAIN MENU"
if (spaceKey()=1) THEN delete object 1 : wait 1000 : goto mainMenu
sync
LOOP
I maked an example for you =]
In the top left of the screen there are the cursor's coordinates..
You can just decorate them and use in your own clicks..
Example:
execute the program and position the mouse at the start of
the "EXIT" and decorate the x position of the cursor..
Then position mouse at the end of the "EXIT" and decorate the
current position..
So you have 2 x cordinades:
1st: the start x of the button
2nd: the end x of the button
Go to the code and place the coordinates you know..
Do the same for y..
a function to help you:
function clickIn(x1,x2,y1,y2)
if ((mousex()=>x1) and (mousex()=<x2) and (mousey()=>y1) and (mousey()=<y2))
if (mouseClick()=1)
clicked=1
else
clicked=0
endif
endif
endfunction clicked
to use this function you:
1st: Copy the function and paste some lines after the end of your code..
2nd: Call the function where you whant it.. but don't forget
to change "x1,x2,y1,y2" paramethers into your values..
example:
sync on : sync rate 0
DO
if (clickIn(46,240,228,260)=1) THEN wait 1000 : end
`The same thing:
`if ((mousex()=>46) and (mousex()=<240) and (mousey()=>228) and (mousey()=<260))
sync
LOOP
function clickIn(x1,x2,y1,y2)
if ((mousex()=>x1) and (mousex()=<x2) and (mousey()=>y1) and (mousey()=<y2))
if (mouseClick()=1)
clicked=1
else
clicked=0
endif
endif
endfunction clicked
And it is all..
This is the 2nd easier way to make menu systems..
[EDIT] Use the image in the attachment to see the utility of the
top left
[/EDIT]
Ok.. good luck, dude
The worst foe lies within the self..