Inside the next method, we will set up the title screen. A colored box, a few text objects, and a timer that will switch the screen automatically to the menu screen, are all we need.
CreateTitleScreen
to the game
class.Method CreateTitleScreen:Int()
layerTitle
.eng.SetDefaultLayer(layerTitle)
Local box := eng.CreateBox(cw,ch,cw/2,ch/2) box.SetColor(55,55,55)
2.0
.Local t1 := eng.CreateText(font1, strTitle, cw/2, ch/2-100, 3) t1.SetScale(2.0) Local t2 := eng.CreateText(font1, "by "+strAuthor, cw/2, ch/2, 3) Local t3 := eng.CreateText(font1, "Version "+strVersion, cw/2, ch/2+50, 3)
tmShowMenu
ID and a time value of 3000
milliseconds. After setting it, close the method.eng.CreateObjTimer(b,tmShowMenu,3000) Return 0 End
You have created a method that will set up the title screen. Because of the timer that is added, it will (once we have added more code later on) switch to the menu screen automatically. The title screen will look like the following screenshot in this game: