Class GameTime
Holds the time state of a Game.
public class GameTime
- Inheritance
-
GameTime
- Inherited Members
Constructors
GameTime()
Create a GameTime instance with a TotalGameTime and ElapsedGameTime of
0
.
public GameTime()
GameTime(TimeSpan, TimeSpan)
Create a GameTime with the specified TotalGameTime and ElapsedGameTime.
public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime)
Parameters
totalGameTime
TimeSpanThe total game time elapsed since the start of the Game.
elapsedGameTime
TimeSpanThe time elapsed since the last call to Update(GameTime).
GameTime(TimeSpan, TimeSpan, bool)
Create a GameTime with the specified TotalGameTime and ElapsedGameTime.
public GameTime(TimeSpan totalRealTime, TimeSpan elapsedRealTime, bool isRunningSlowly)
Parameters
totalRealTime
TimeSpanThe total game time elapsed since the start of the Game.
elapsedRealTime
TimeSpanThe time elapsed since the last call to Update(GameTime).
isRunningSlowly
boolA value indicating if the Game is running slowly.
Properties
ElapsedGameTime
Time since the last call to Update(GameTime).
public TimeSpan ElapsedGameTime { get; set; }
Property Value
IsRunningSlowly
Indicates whether the Game is running slowly.
This flag is set to true
when IsFixedTimeStep is set to true
and a tick of the game loop takes longer than TargetElapsedTime for
a few frames in a row.
public bool IsRunningSlowly { get; set; }
Property Value
TotalGameTime
Time since the start of the Game.
public TimeSpan TotalGameTime { get; set; }