Our title screen will be composed of a nice single-colored background, the text Balls Out!, and two text buttons to Play and Exit the game:
1. Create the
CreateTitleScreen
method inside thegame
class.Method CreateTitleScreen:Int ()
2. Create a new box object, assign it to the title layer, and set the color to a nice blue.
Local box:ftObject = eng.CreateBox(cw-20,ch-20,cw/2,ch/2) box.SetLayer(layerTitle) box.SetColor(0,0,255)
3. Now, create a text object that is also assigned to the title layer. Scale it to the factor
3
.Local tx1:ftObject = eng.CreateText(font1,"Balls Out!",cw/2,ch/5,1) tx1.SetLayer(layerTitle) tx1.SetScale(3.0)
4. To start and exit the game, we need two text buttons, both scaled to factor
1.5
and assigned to the title layer.Local b1:ftObject = CreateTextButton(font1, "Play", cw/2,ch/5*3, btnPlay, layerTitle) b1.SetScale(1.5) Local b3:ftObject = CreateTextButton(font1, "Exit", cw/2,ch/5*4, btnExit, layerTitle) b3.SetScale(1.5...