Time for action — detailing the OnRender method

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 the fps field of the game class.
    Method OnRender:Int()
    fps = eng.GetFPS()
    
  2. Now tell the engine to render its objects.
    eng.Render()
    Return 0
    End
    

What just happened?

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.123.106