Search Results for

    Show / Hide Table of Contents

    Class Time

    Game ticking and timing system.

    Inheritance
    Time
    Assembly: FlaxEngine.dll
    File: Engine/Engine/Time.h
    Syntax
    public class Time

    Fields

    Current

    The current tick data (update, physics or draw).

    Declaration
    public static TickData* Current
    Field Value
    TickData

    Draw

    The rendering data.

    Declaration
    public static TickData Draw
    Field Value
    TickData

    DrawFPS

    The target amount of the frames rendered per second (target game FPS).

    To get the actual game FPS use Engine.FramesPerSecond

    Declaration
    public static float DrawFPS
    Field Value
    float

    Physics

    The physics simulation updating data.

    Declaration
    public static FixedStepTickData Physics
    Field Value
    FixedStepTickData

    PhysicsFPS

    The target amount of the physics simulation updates per second (also fixed updates frequency).

    Declaration
    public static float PhysicsFPS
    Field Value
    float

    StartupTime

    The time at which the game started (UTC local).

    Declaration
    public static DateTime StartupTime
    Field Value
    DateTime

    TimeScale

    The game time scale factor. Default is 1.

    Declaration
    public static float TimeScale
    Field Value
    float

    Update

    The game logic updating data.

    Declaration
    public static TickData Update
    Field Value
    TickData

    UpdateFPS

    The target amount of the game logic updates per second (script updates frequency).

    Declaration
    public static float UpdateFPS
    Field Value
    float

    Methods

    GetCurrentSafe()

    Gets the current tick data (safety so returns Update tick data if no active).

    Declaration
    public static TickData* GetCurrentSafe()
    Returns
    TickData

    The tick data.

    GetDeltaTime()

    Gets time in seconds it took to complete the last frame, TimeScale dependent.

    Declaration
    public static float GetDeltaTime()
    Returns
    float

    GetGamePaused()

    Gets the value indicating whenever game logic is paused (physics, script updates, etc.).

    Declaration
    public static bool GetGamePaused()
    Returns
    bool

    True if game is being paused, otherwise false.

    GetGameTime()

    Gets time at the beginning of this frame. This is the time in seconds since the start of the game.

    Declaration
    public static float GetGameTime()
    Returns
    float

    GetNextTick()

    Gets the time of next upcoming tick data of ticking group with defined update frequency.

    Declaration
    public static double GetNextTick()
    Returns
    double

    The time of next tick.

    GetTimeSinceStartup()

    Gets the time since startup in seconds (unscaled).

    Declaration
    public static float GetTimeSinceStartup()
    Returns
    float

    GetUnscaledDeltaTime()

    Gets timeScale-independent time in seconds it took to complete the last frame.

    Declaration
    public static float GetUnscaledDeltaTime()
    Returns
    float

    GetUnscaledGameTime()

    Gets timeScale-independent time at the beginning of this frame. This is the time in seconds since the start of the game.

    Declaration
    public static float GetUnscaledGameTime()
    Returns
    float

    SetFixedDeltaTime(bool enable, float value)

    Sets the fixed FPS for game logic updates (draw and update).

    Declaration
    public static void SetFixedDeltaTime(bool enable, float value)
    Parameters
    bool enable

    True if enable this feature, otherwise false.

    float value

    The fixed draw/update rate for the time.

    SetGamePaused(bool value)

    Sets the value indicating whenever game logic is paused (physics, script updates, etc.).

    Declaration
    public static void SetGamePaused(bool value)
    Parameters
    bool value

    True if pause game logic, otherwise false.

    Synchronize()

    Synchronizes update, fixed update and draw. Resets any pending deltas for fresh ticking in sync.

    Declaration
    public static void Synchronize()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat