GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • Game
      • GameElement
      • GameEventHandler
      • GenesisWindow
      • IGameBehavior
      • Input
      • Layer
      • Light
      • Scene
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • CapsuleCollider
      • ConvexHullBehavior
      • QubeConvexHull
      • SphereCollider
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • Model
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
    • Genesis.Graphics
      • Animation
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Glyphe
      • IRenderDevice
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • Shader
      • ShaderProgram
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • ClassicGL
      • GLRenderer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • FrameShape
      • GlypheShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • HitResult
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Raycast
    • Genesis.UI
      • Canvas
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget

    Class Game

    Represents the main game class responsible for managing game loops, scenes, rendering, and updates.

    Inheritance
    object
    Game
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Core
    Assembly: Genesis.dll
    Syntax
    public class Game

    Constructors

    Game(IRenderDevice, Viewport)

    Creates a new instance of the Game class.

    Declaration
    public Game(IRenderDevice renderDevice, Viewport viewport)
    Parameters
    Type Name Description
    IRenderDevice renderDevice

    The rendering device to use.

    Viewport viewport

    The viewport configuration.

    Properties

    AssetManager

    Gets or sets the asset manager for handling game assets.

    Declaration
    public AssetManager AssetManager { get; set; }
    Property Value
    Type Description
    AssetManager

    DeltaTime

    Gets or sets the time elapsed since the last frame in milliseconds.

    Declaration
    public double DeltaTime { get; set; }
    Property Value
    Type Description
    double

    FPS

    Gets or sets the current frames per second achieved by the game loop.

    Declaration
    public double FPS { get; set; }
    Property Value
    Type Description
    double

    LastFrame

    Gets or sets the timestamp of the last frame.

    Declaration
    public long LastFrame { get; set; }
    Property Value
    Type Description
    long

    RenderDevice

    Gets or sets the rendering device used by the game.

    Declaration
    public IRenderDevice RenderDevice { get; set; }
    Property Value
    Type Description
    IRenderDevice

    Run

    Gets or sets a value indicating whether the game loop is running.

    Declaration
    public bool Run { get; set; }
    Property Value
    Type Description
    bool

    Scenes

    Gets or sets the list of scenes in the game.

    Declaration
    public List<Scene> Scenes { get; set; }
    Property Value
    Type Description
    List<Scene>

    SelectedScene

    Gets or sets the currently selected scene.

    Declaration
    public Scene SelectedScene { get; set; }
    Property Value
    Type Description
    Scene

    Storage

    Gets or sets the storage object for managing game data.

    Declaration
    public Storage Storage { get; set; }
    Property Value
    Type Description
    Storage

    TargetFPS

    Gets or sets the target frames per second for the game loop.

    Declaration
    public int TargetFPS { get; set; }
    Property Value
    Type Description
    int

    Viewport

    Gets or sets the viewport configuration for rendering.

    Declaration
    public Viewport Viewport { get; set; }
    Property Value
    Type Description
    Viewport

    Methods

    AddScene(Scene)

    Adds a scene to the list of scenes.

    Declaration
    public Scene AddScene(Scene scene)
    Parameters
    Type Name Description
    Scene scene

    The Scene object to be added.

    Returns
    Type Description
    Scene

    The added Scene object.

    GetElementCenterScreenLocation2D(GameElement)

    Returns the screen location of the given element with a center anchor.

    Declaration
    public Vec3 GetElementCenterScreenLocation2D(GameElement element)
    Parameters
    Type Name Description
    GameElement element

    The GameElement to get the centered screen coordinates for.

    Returns
    Type Description
    Vec3

    A Vec3 representing the centered screen coordinates of the element.

    GetElementScreenLocation2D(GameElement)

    Get the screen coordinates of the given element.

    Declaration
    public Vec3 GetElementScreenLocation2D(GameElement element)
    Parameters
    Type Name Description
    GameElement element

    The GameElement to get the screen coordinates for.

    Returns
    Type Description
    Vec3

    A Vec3 representing the screen coordinates of the element.

    GetSceneCord(Vec3)

    Transforms a display vector to a vector inside the scene.

    Declaration
    public Vec3 GetSceneCord(Vec3 location)
    Parameters
    Type Name Description
    Vec3 location

    The display vector to transform.

    Returns
    Type Description
    Vec3

    A Vec3 representing the transformed vector inside the scene.

    InitGameElement(GameElement)

    Initializes a GameElement within the game environment.

    Declaration
    public void InitGameElement(GameElement element)
    Parameters
    Type Name Description
    GameElement element

    The GameElement to be initialized.

    LoadScene(string)

    Loads a scene with the given name.

    Declaration
    public void LoadScene(string name)
    Parameters
    Type Name Description
    string name

    The name of the scene to be loaded.

    Loop()

    Main game loop. Handles updates and rendering.

    Declaration
    public void Loop()

    Start()

    Starts the main game loop.

    Declaration
    public void Start()

    Stop()

    Stops the main game loop.

    Declaration
    public void Stop()

    Events

    AfterRender

    Event triggered after rendering.

    Declaration
    public event GameEventHandler AfterRender
    Event Type
    Type Description
    GameEventHandler

    AfterUpdate

    Event triggered after the game update.

    Declaration
    public event GameEventHandler AfterUpdate
    Event Type
    Type Description
    GameEventHandler

    BeforeRender

    Event triggered before rendering.

    Declaration
    public event GameEventHandler BeforeRender
    Event Type
    Type Description
    GameEventHandler

    BeforeUpdate

    Event triggered before the game update.

    Declaration
    public event GameEventHandler BeforeUpdate
    Event Type
    Type Description
    GameEventHandler

    OnDispose

    Event triggered when the game is disposed.

    Declaration
    public event GameEventHandler OnDispose
    Event Type
    Type Description
    GameEventHandler

    OnInit

    Event triggered when the game initializes.

    Declaration
    public event GameEventHandler OnInit
    Event Type
    Type Description
    GameEventHandler

    OnRenderBeginn

    Event triggered at the beginning of rendering.

    Declaration
    public event GameEventHandler OnRenderBeginn
    Event Type
    Type Description
    GameEventHandler

    OnRenderEnd

    Event triggered at the end of rendering.

    Declaration
    public event GameEventHandler OnRenderEnd
    Event Type
    Type Description
    GameEventHandler

    OnUpdate

    Event triggered during the game update.

    Declaration
    public event GameEventHandler OnUpdate
    Event Type
    Type Description
    GameEventHandler
    In this article
    Back to top Generated by DocFX