Does anyone know any good menu design tutorials or anything similar? It’d be helpful. Thanks
Sorry, thought I posted the link.
Here is some basic code to show you how it works.
gameState variable is the screen you want (start menu, main game, try again, etc.)
You add a button and text over the button, then add touch input to make it switch to different gameState.
In an actual game, the play screen will link to the main game, then when the game is over it will change gameState to the back screen, which has the score and high score or whatever and links back to the play screen.
displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT_ANY)
function setup()
button=readImage("Cargo Bot:Dialogue Box") -- store button graphic as variable
font("Futura-CondensedExtraBold") -- font style
fontSize(128) -- font size
fill(0, 0, 0, 255) -- font color
gameState=0 -- first screen that loads
end
function draw()
if gameState==0 then
background(0, 0, 0, 255) -- black background
sprite(button, WIDTH/2,HEIGHT/2,512,256) -- place button and determine size
text("PLAY",WIDTH/2,HEIGHT/2) -- place text
-- if touch happens in location that button covers then change scene
if CurrentTouch.state==BEGAN then
if CurrentTouch.x>WIDTH/2-256 and CurrentTouch.x<WIDTH/2+256
and CurrentTouch.y>HEIGHT/2-128 and CurrentTouch.y<HEIGHT/2+128 then
gameState=1
end
end
end
-- same as above
if gameState==1 then
background(0, 0, 0, 255)
sprite(button, WIDTH/2,HEIGHT/4,512,256)
text("BACK",WIDTH/2,HEIGHT/4)
if CurrentTouch.state==BEGAN then
if CurrentTouch.x>WIDTH/2-256 and CurrentTouch.x<WIDTH/2+256
and CurrentTouch.y>HEIGHT/4-128 and CurrentTouch.y<HEIGHT/4+128 then
gameState=0
end
end
end
end
@Perscirious Have you seen the “Wiki” choice at the top of the forum… There’s a lot of info in there as well.
Try this link.
http://codeatuts.blogspot.com/p/about.html
Do you have a link to his/her’s website?
@Reefwing has a good tutorial on a menu (tutorials 1-5 on this site). Once you understand the basics of how that menu works, you can design your own based on the basic template those tutorials show.