The next method will set up the two text objects for us:
gameclass, add a new method called
Method CreateInfoText:Int ()
txtScoretext object from the
font1font object. Set it to the background layer.
txtScore = eng.CreateText(font1,"Score: "+score,40,46) txtScore.SetLayer(layerBackGround)
txtFPS = eng.CreateText(font1,"FPS: "+999, eng.canvasWidth-45,46,2) txtFPS.SetLayer(layerBackGround)
Return 0 End
To display some info text values, we have created two text objects with the
CreateText method of fantomEngine. Later in the game, we will update them with the
SetText method of each object. ...