To create text buttons, we will reuse some code that we have created in a previous chapter.
CreateTextButton method from Chapter 4, Game #3, CometCrusher, into the
Method CreateTextButton:ftObject (font:ftFont, txt:String, xp:Int, yp:Int, id:Int, layer:ftLayer) Local but:ftObject = eng.CreateText(font,txt,xp,yp,1) but.SetTag(id) but.SetTouchMode(2) but.SetLayer(layer) Return but End
Reusing code is a good thing. Why reinvent the wheel several times. That is why we use the fantomEngine framework in the first place, isn't it?
Now that we have a method to create text buttons, we can define the menu screen.