To update these text objects, we will create the
UpdateInfoText method. Each text object has a text field that stores the text string value. The content of this field will be drawn on the screen.
txtScore.SetText("Score: "+score) txtFPS.SetText("FPS: "+fps)
Return 0 End
Since we created a separate method to update the info text objects, we can call it at any time we wish. Later on, we will do this in the
OnUpdate event on the game class, but the
OnRender event would be good, too.