+Class GameExtensions +
+ +- Namespace
- Stride.CommunityToolkit.Games
- Assembly
- Stride.CommunityToolkit.dll
public static class GameExtensions
+ -
+
- Inheritance +
-
+
+ GameExtensions+
+
Methods +
+ + + + ++ DeltaTime(IGame) + +
+ +Gets the time elapsed since the last game update in seconds as a single-precision floating-point number.
+public static float DeltaTime(this IGame gameTime)
+ Parameters
+-
+
gameTime
IGame
+ The IGame interface providing access to game timing information.
+
+
Returns
+-
+
- float +
The time elapsed since the last game update in seconds.
+
+
+ DeltaTimeAccurate(IGame) + +
+ +Gets the time elapsed since the last game update in seconds as a double-precision floating-point number.
+public static double DeltaTimeAccurate(this IGame gameTime)
+ Parameters
+-
+
gameTime
IGame
+ The IGame interface providing access to game timing information.
+
+
Returns
+-
+
- double +
The time elapsed since the last game update in seconds with double precision.
+
+
+ FPS(IGame) + +
+ +Retrieves the current frames per second (FPS) rate of the running game.
+public static float FPS(this IGame game)
+ Parameters
+-
+
game
IGame
+ The game instance from which to obtain the FPS rate.
+
+
Returns
+-
+
- float +
The current FPS rate of the game.
+
+
+ SetFocusLostFPS(IGame, int) + +
+ +Sets the maximum frames per second (FPS) rate for the game when not in focus. +Set to 0 for max possible FPS.
+public static void SetFocusLostFPS(this IGame game, int targetFPS)
+ Parameters
+ + + + + + + + + + + + + + + ++ SetMaxFPS(IGame, int) + +
+ +Sets the maximum frames per second (FPS) rate for the game. +Set to 0 for max possible FPS.
+public static void SetMaxFPS(this IGame game, int targetFPS)
+