To determine an FPS value in fantomEngine, a call to its GetFPS
method will return the current FPS value, as follows:
1. Store the output of the
GetFPS
call in thefps
field of thegame
class.Method OnRender:Int() fps = eng.GetFPS()
2. Now tell the engine to render its objects.
eng.Render() Return 0 End
Inside the OnRender
method, we determine the current frames per second value that indicates how many times the game is able to display the content. We will later create a method to update the corresponding text object called txtFPS
. We also told the engine to render all objects in one batch.