In the menu screen we create, the game title will also be displayed at the top.
CreateMenuScreen
into the game
class.Method CreateMenuScreen:Int()
layerMenu
.eng.SetDefaultLayer(layerMenu)
Local b := eng.CreateBox(cw,ch,cw/2,ch/2) b.SetColor(55,55,55)
2
.Local t1 := eng.CreateText(font1, strTitle, cw/2, ch/2-100, 3) t1.SetScale(2.0)
Play, Score
, and Exit
.Local bt1 := CreateTextButton(font1, "Play", cw/2, (ch/9)*4, btnPlay, layerMenu) Local bt3 := CreateTextButton(font1, "Score", cw/2, (ch/9)*5, btnScore, layerMenu) Local bt6 := CreateTextButton(font1, "Exit", cw/2, (ch/9)*7, btnExit, layerMenu) Close of this method. Return 0 End
To set up the menu screen, you just need to call the method once in the OnCreate
event of the game. If you need more menu entries, just add them here. The menu screen will look like the following screenshot of the game:
3.138.37.151