tehehehe.
sure bro
Basically i loaded all of my images up. i designed my images.
1) load game button
2) save game button
3) options button
4) exit button.
in photoshop elements i copied all of these files and changed the tint so the copies had a red tint... moving on.
i specified all of my varibles and i reset all of my "reactors" or code that tells the program that you moved your mouse over the image, like so:
`Variables
New_gameX#=550 : New_GameY#=590
Load_GameX#=800 : Load_GameY#=590
optionsX#=680 : optionsY#=690
ExitX#=680 : ExitY#=790
titleX#=300 : titleY#=120
newgamepressed=0
loadgamepressed=0
optionspressed=0
exitpressed=0
The most crucial part of the code is
if mousex()>553 and mousex()<553+230
if mousey()>592 and mousey()<592+80
newGamePressed=1
endif
endif
if newGamepressed=1 then paste image 7,new_gamex#,new_gamey# else paste image 2,new_gamex#,new_gamey#
if newgamepressed=1
newGamepressed=mouseclick()
if mouseclick()=1
print "new_game(): Function Currently disabled"
newGamepressed=0
endif
else
newGamepressed=0
endif
ill explain:
basically i got out my pen and paper. and at the top of my program i put (in the main loop)
"CLS"
print mouseX()
print mousey()
i moved my mouse over each of the corners of my images so i got the dementions. i took X1 which in this case is 553 and took X2 which was 783 and subtracted 783-553 which = 230. in the
if mousex()>553 and mousex()<553+230
if mousey()>592 and mousey()<592+80
newGamePressed=1
endif
endif
its saying "if the mouse is 553 or more pixels away from the edge but less than 553+230 pixels then "newgamepressed=1" (newgamepressed is our variable too tell the program that we have moused over the new game button.
Now the program knows that we have moused over the button and now we tell it too replace the current new game image with the red one. so it gives it a color difference when you mouse over it. here is the next part of code:
if newGamepressed=1 then paste image 7,new_gamex#,new_gamey# else paste image 2,new_gamex#,new_gamey#
if newgamepressed=1
newGamepressed=mouseclick()
if mouseclick()=1
print "new_game(): Function Currently disabled"
newGamepressed=0
endif
else
newGamepressed=0
endif
on the first line its pasteing the red image over the regular one.
and then its saying, but if the mouse is not in that area then replace the image with the default image (non-red one).
then it says "if newgamepressed=1 then newgamepressed=mouseclick()" this means that now newgamepressed is controlled by the mouseclicking. so "IF the user clicks the mouse (if mouseclick()=1)
then its going too execute your action. in this case i have print "new_game(): Function Currently disabled" because i have not created the load game function yet
. then its returning the varriable too zero. and it uses the "else" command after that, else meens if NONE of this happend then the variable would remain 0.
i hope this answered some of your questions sixty squares. and good luck with your menus.
if you have any more questions/concerns please feel free too ask
thx,
-snow