Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Game Class

    Namespace: Stride.Engine
    Assembly: Stride.Engine.dll

    Main Game class system.

    System.Object → DisposeBase → ComponentBase → GameBase → Game
    Derived from Game:

    public class Game : GameBase, IDisposable, IComponent, IReferencable, ICollectorHolder, IGame, ISceneRendererContext, IGameSettingsService
    Name Description
    Constructors
    Game()

    Initializes a new instance of the Game class.

    Properties
    Audio

    Gets the audio system.

    AutoLoadDefaultSettings

    Automatically initializes game settings like default scene, resolution, graphics profile.

    ConsoleLogLevel

    Gets or sets the default console log level.

    ConsoleLogMode

    Gets or sets the console log mode. See remarks.

    DebugTextSystem

    Gets the game profiler system.

    EffectSystem

    Gets the effect system.

    Font

    Gets the font system.

    GraphicsDeviceManager

    Gets the graphics device manager.

    Input

    Gets the input manager.

    ProfilingSystem

    Gets the game profiler system.

    SceneSystem

    Gets the scene system.

    Script

    Gets the script system.

    Settings

    Readonly game settings as defined in the GameSettings asset Please note that it will be populated during initialization It will be ok to read them after the GameStarted event or after initialization

    SpriteAnimation

    Gets the sprite animation system.

    Streaming

    Gets the streaming system.

    VRDeviceSystem

    Gets the VR Device System.

    Methods
    ConfirmRenderingSettings(Boolean)
    Destroy()
    EndDraw(Boolean)
    GetLogListener()
    Initialize()
    LoadContent()

    Loads the content.

    PrepareContext()

    Creates or updates Context before window and device are created.

    Events
    GameDestroyed

    Static event that will be fired when a game is destroyed

    GameStarted

    Static event that will be fired when a game is initialized

    | Improve this Doc View Source

    Constructors


    Game()

    Initializes a new instance of the Game class.

    public Game()
    | Improve this Doc View Source

    Properties


    Audio

    Gets the audio system.

    public AudioSystem Audio { get; }
    Property Value
    Type Description
    AudioSystem

    The audio.


    AutoLoadDefaultSettings

    Automatically initializes game settings like default scene, resolution, graphics profile.

    public bool AutoLoadDefaultSettings { get; set; }
    Property Value
    Type Description
    System.Boolean

    ConsoleLogLevel

    Gets or sets the default console log level.

    public LogMessageType ConsoleLogLevel { get; set; }
    Property Value
    Type Description
    LogMessageType

    The console log level.


    ConsoleLogMode

    Gets or sets the console log mode. See remarks.

    public ConsoleLogMode ConsoleLogMode { get; set; }
    Property Value
    Type Description
    ConsoleLogMode

    The console log mode.

    Remarks

    Defines how the console will be displayed when running the game. By default, on Windows, It will open only on debug if there are any messages logged.


    DebugTextSystem

    Gets the game profiler system.

    public DebugTextSystem DebugTextSystem { get; }
    Property Value
    Type Description
    DebugTextSystem

    EffectSystem

    Gets the effect system.

    public EffectSystem EffectSystem { get; }
    Property Value
    Type Description
    EffectSystem

    The effect system.


    Font

    Gets the font system.

    public IFontFactory Font { get; }
    Property Value
    Type Description
    IFontFactory

    The font system.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The font system is not initialized yet


    GraphicsDeviceManager

    Gets the graphics device manager.

    public GraphicsDeviceManager GraphicsDeviceManager { get; }
    Property Value
    Type Description
    GraphicsDeviceManager

    The graphics device manager.


    Input

    Gets the input manager.

    public InputManager Input { get; }
    Property Value
    Type Description
    InputManager

    The input.


    ProfilingSystem

    Gets the game profiler system.

    public GameProfilingSystem ProfilingSystem { get; }
    Property Value
    Type Description
    GameProfilingSystem

    SceneSystem

    Gets the scene system.

    public SceneSystem SceneSystem { get; }
    Property Value
    Type Description
    SceneSystem

    The scene system.


    Script

    Gets the script system.

    public ScriptSystem Script { get; }
    Property Value
    Type Description
    ScriptSystem

    The script.


    Settings

    Readonly game settings as defined in the GameSettings asset Please note that it will be populated during initialization It will be ok to read them after the GameStarted event or after initialization

    public GameSettings Settings { get; }
    Property Value
    Type Description
    GameSettings

    SpriteAnimation

    Gets the sprite animation system.

    public SpriteAnimationSystem SpriteAnimation { get; }
    Property Value
    Type Description
    SpriteAnimationSystem

    The sprite animation system.


    Streaming

    Gets the streaming system.

    public StreamingManager Streaming { get; }
    Property Value
    Type Description
    StreamingManager

    The streaming system.


    VRDeviceSystem

    Gets the VR Device System.

    public VRDeviceSystem VRDeviceSystem { get; }
    Property Value
    Type Description
    VRDeviceSystem
    | Improve this Doc View Source

    Methods


    ConfirmRenderingSettings(Boolean)

    public override void ConfirmRenderingSettings(bool gameCreation)
    Parameters
    Type Name Description
    System.Boolean gameCreation
    Overrides
    GameBase.ConfirmRenderingSettings(Boolean)

    Destroy()

    protected override void Destroy()
    Overrides
    GameBase.Destroy()

    EndDraw(Boolean)

    protected override void EndDraw(bool present)
    Parameters
    Type Name Description
    System.Boolean present
    Overrides
    GameBase.EndDraw(Boolean)

    GetLogListener()

    protected virtual LogListener GetLogListener()
    Returns
    Type Description
    LogListener

    Initialize()

    protected override void Initialize()
    Overrides
    GameBase.Initialize()

    LoadContent()

    Loads the content.

    protected virtual Task LoadContent()
    Returns
    Type Description
    System.Threading.Tasks.Task

    PrepareContext()

    Creates or updates Context before window and device are created.

    protected override void PrepareContext()
    Overrides
    GameBase.PrepareContext()
    | Improve this Doc View Source

    Events


    GameDestroyed

    Static event that will be fired when a game is destroyed

    public static event EventHandler GameDestroyed
    Event Type
    Type Description
    System.EventHandler

    GameStarted

    Static event that will be fired when a game is initialized

    public static event EventHandler GameStarted
    Event Type
    Type Description
    System.EventHandler

    Inherited Members

    GameBase.graphicsDeviceManager
    GameBase.Log
    GameBase.Activated
    GameBase.Deactivated
    GameBase.Exiting
    GameBase.WindowCreated
    GameBase.UnhandledException
    GameBase.UpdateTime
    GameBase.DrawTime
    GameBase.DrawInterpolationFactor
    GameBase.Content
    GameBase.GameSystems
    GameBase.Context
    GameBase.GraphicsDevice
    GameBase.GraphicsContext
    GameBase.InactiveSleepTime
    GameBase.IsActive
    GameBase.IsExiting
    GameBase.IsFixedTimeStep
    GameBase.ForceOneUpdatePerDraw
    GameBase.IsDrawDesynchronized
    GameBase.IsMouseVisible
    GameBase.LaunchParameters
    GameBase.IsRunning
    GameBase.Services
    GameBase.TargetElapsedTime
    GameBase.WindowMinimumUpdateRate
    GameBase.MinimizedMinimumUpdateRate
    GameBase.TreatNotFocusedLikeMinimized
    GameBase.DrawWhileMinimized
    GameBase.Window
    GameBase.FullPlatformName
    GameBase.Exit()
    GameBase.ResetElapsedTime()
    GameBase.Run(GameContext)
    GameBase.SuppressDraw()
    GameBase.Tick()
    GameBase.RawTickProducer()
    GameBase.RawTick(TimeSpan, Int32, Single, Boolean)
    GameBase.BeginRun()
    GameBase.EndRun()
    GameBase.BeginDraw()
    GameBase.Draw(GameTime)
    GameBase.Update(GameTime)
    GameBase.OnActivated(Object, EventArgs)
    GameBase.OnDeactivated(Object, EventArgs)
    GameBase.OnExiting(Object, EventArgs)
    GameBase.OnWindowCreated()
    GameBase.ShowMissingRequirementMessage(Exception)
    GameBase.UnloadContent()
    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation