This new helper method will be added to the game
class:
1. Insert a new class called
CreateTextButton
. Its parameters are a font object, the text, its position, button ID, and the layer that the button is added to.Method CreateTextButton:ftObject (font:ftFont, txt:String, xp:Int, yp:Int, id:Int, layer:ftLayer)
2. Create a new next object.
Local but:ftObject = eng.CreateText(font,txt,xp,yp,1)
3. It its tag with the ID and the touch mode to a rectangular hit test.
but.SetTag(id) but.SetTouchMode(2)
4. Now, set the layer and close the method.
but.SetLayer(layer) Return but End