Confusion about gameTime. How does it work?

From my understanding its supposed to handle time, but how does it work since in the GameTime class GameTime constructor is empty with two overloads and gameTime object doesn’t have anyparameters? How does gameTime get time?
i’m sure this is a noob question but i’m asking anyway since i don’t understand it.

The class itself just holds some parameters which get filled by MonoGames Game Class where it basically uses a StopWatch to fill that values. (It also handles fixed Timesteps etc)

You then get this object in the Update function of your overloaded Game Class (most likely Game1.cs). Basically all you need to know is the elapsed time between the Update Calls.

Remember, that when using FixedTimeStep, your Update-Function may be called in a different frequency, then your Draw method

1 Like

oh i get it now. thanks for answering!