Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Better way to access gameTime?

$
0
0

@ForbiddenSoul wrote:

I'm trying to access MonoGame's gameTime outside of my Game's Update and Draw functions.
They take a parameter of GameTime gameTime, and I don't know where that comes from.

Currently I declared a public static GameTime gameTime in the Game1 Class and update it's value every Update and Draw using the value that was passed into them.

It seems redundant though as it is getting an already existing gameTime from somewhere else, which is also updated (I'm guessing only once) elsewhere.

Is there a better way to access gameTime other than my static option, or is that it?
Can someone explain where the passed in gameTime comes from?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles