This code works perfectly (if you have the media), and it lets me click on things and it does what I want.
LOAD IMAGE "StartGame.png", 1
LOAD IMAGE "Options.png", 2
LOAD IMAGE "Quit.png", 3
SET TEXT FONT "Ringbearer Medium"
SET TEXT SIZE 24
DO
MainMenu()
LOOP
FUNCTION MainMenu()
PASTE IMAGE 1, 100, 100, 1
PASTE IMAGE 2, 100, 175, 1
PASTE IMAGE 3, 100, 250, 1
IF MOUSEX() >= 100 AND MOUSEX() <= 228 AND MOUSEY() >= 100 AND MOUSEY() <= 151 AND MOUSECLICK() = 1
CLS
StartMenu()
WAIT KEY
CLS
MainMenu()
ENDIF
IF MOUSEX() >= 100 AND MOUSEX() <= 228 AND MOUSEY() >= 175 AND MOUSEY() <= 226 AND MOUSECLICK() = 1
CLS
OptionMenu()
WAIT KEY
CLS
MainMenu()
ENDIF
IF MOUSEX() >= 100 AND MOUSEX() <= 328 AND MOUSEY() >= 250 AND MOUSEY() <= 301 AND MOUSECLICK() = 1
Quit()
ENDIF
ENDFUNCTION
FUNCTION StartMenu()
PRINT "Start Menu"
ENDFUNCTION
FUNCTION OptionMenu()
PRINT "Option Menu"
ENDFUNCTION
FUNCTION Quit()
END
ENDFUNCTION
But if you change PASTE IMAGE commands to this:
LOAD IMAGE "StartGame.png", 1
LOAD IMAGE "Options.png", 2
LOAD IMAGE "Quit.png", 3
SET TEXT FONT "Ringbearer Medium"
SET TEXT SIZE 24
DO
MainMenu()
LOOP
FUNCTION MainMenu()
SPRITE 1, 100, 100, 1
SPRITE 2, 100, 175, 2
SPRITE 3, 100, 250, 3
IF MOUSEX() >= 100 AND MOUSEX() <= 228 AND MOUSEY() >= 100 AND MOUSEY() <= 151 AND MOUSECLICK() = 1
CLS
StartMenu()
WAIT KEY
CLS
MainMenu()
ENDIF
IF MOUSEX() >= 100 AND MOUSEX() <= 228 AND MOUSEY() >= 175 AND MOUSEY() <= 226 AND MOUSECLICK() = 1
CLS
OptionMenu()
WAIT KEY
CLS
MainMenu()
ENDIF
IF MOUSEX() >= 100 AND MOUSEX() <= 328 AND MOUSEY() >= 250 AND MOUSEY() <= 301 AND MOUSECLICK() = 1
Quit()
ENDIF
ENDFUNCTION
FUNCTION StartMenu()
PRINT "Start Menu"
ENDFUNCTION
FUNCTION OptionMenu()
PRINT "Option Menu"
ENDFUNCTION
FUNCTION Quit()
END
ENDFUNCTION
The buttons don't work. Can somebody tell me what I am doing wrong and give me an idea of how to fix it?
I'm not who you think...