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 Scene

    Represents a game scene in the Genesis framework.

    Inheritance
    object
    Scene
    Scene3D
    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 Scene

    Constructors

    Scene()

    Creates a new game scene.

    Declaration
    public Scene()

    Scene(string)

    Creates a new game scene with the specified name.

    Declaration
    public Scene(string name)
    Parameters
    Type Name Description
    string name

    Properties

    AfterCanvasRender

    Event handler triggered after UI canvas rendering.

    Declaration
    public SceneEventHandler AfterCanvasRender { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    AfterSceneRender

    Event handler triggered after scene rendering.

    Declaration
    public SceneEventHandler AfterSceneRender { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    BackgroundTexture

    Set or gets the background texture for the scene

    Declaration
    public Texture BackgroundTexture { get; set; }
    Property Value
    Type Description
    Texture

    BeforeCanvasPreperation

    Event handler triggered before UI canvas preparation.

    Declaration
    public SceneEventHandler BeforeCanvasPreperation { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    BeforeCanvasRender

    Event handler triggered before UI canvas rendering.

    Declaration
    public SceneEventHandler BeforeCanvasRender { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    BeforeScenePreperation

    Event handler triggered before scene preparation.

    Declaration
    public SceneEventHandler BeforeScenePreperation { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    BeforeSceneRender

    Event handler triggered before scene rendering.

    Declaration
    public SceneEventHandler BeforeSceneRender { get; set; }
    Property Value
    Type Description
    SceneEventHandler

    Camera

    Gets or sets the camera used for rendering the scene.

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

    Canvas

    Gets or sets the list of UI canvases within the scene.

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

    Layer

    Gets or sets the list of layers within the scene.

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

    Name

    Gets or sets the name of the scene.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    string

    OnSceneResize

    Event handler triggered when the scene is resized.

    Declaration
    public SceneSizeEvenHandler OnSceneResize { get; set; }
    Property Value
    Type Description
    SceneSizeEvenHandler

    PhysicHandler

    Gets or sets the physics handler for the scene.

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

    Methods

    AddCanvas(Canvas)

    Adds a new ui canvas to the scene

    Declaration
    public Canvas AddCanvas(Canvas canvas)
    Parameters
    Type Name Description
    Canvas canvas
    Returns
    Type Description
    Canvas

    AddGameElement(string, GameElement)

    Adds a GameElement in the scene. It will be placed in the given layer

    Declaration
    public void AddGameElement(string layerName, GameElement gameElement)
    Parameters
    Type Name Description
    string layerName
    GameElement gameElement

    AddGameElements(string, List<GameElement>)

    Adds GameElements into the scene. The elements will be placed in the given layer

    Declaration
    public void AddGameElements(string layer, List<GameElement> gameElements)
    Parameters
    Type Name Description
    string layer
    List<GameElement> gameElements

    AddLayer(Layer)

    Adds a layer to the scene

    Declaration
    public void AddLayer(Layer layer)
    Parameters
    Type Name Description
    Layer layer

    AddLayer(string)

    Adds a layer to the scene

    Declaration
    public void AddLayer(string layerName)
    Parameters
    Type Name Description
    string layerName

    GetCanvas(string)

    Gets the canvas with the given name

    Declaration
    public Canvas GetCanvas(string name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    Canvas

    GetElement(string)

    Gets the element with the given name. This function searchs in every layer until it finds a element with an equal name.

    Declaration
    public GameElement GetElement(string name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    GameElement

    GetElement(string, string)

    Gets the element with the given name out of the given layer.

    Declaration
    public GameElement GetElement(string layerName, string name)
    Parameters
    Type Name Description
    string layerName
    string name
    Returns
    Type Description
    GameElement

    GetElements(string)

    Gets the elements from the given layer

    Declaration
    public List<GameElement> GetElements(string layername)
    Parameters
    Type Name Description
    string layername
    Returns
    Type Description
    List<GameElement>

    GetElements(string[])

    Gets the elements from the given layers

    Declaration
    public List<GameElement> GetElements(string[] layer)
    Parameters
    Type Name Description
    string[] layer
    Returns
    Type Description
    List<GameElement>

    GetLayer(string)

    Gets the layer with the given name

    Declaration
    public Layer GetLayer(string layername)
    Parameters
    Type Name Description
    string layername
    Returns
    Type Description
    Layer

    GetWidget(string, string)

    Gets a entity with the given name from the canvas

    Declaration
    public Widget GetWidget(string canvasName, string entityName)
    Parameters
    Type Name Description
    string canvasName
    string entityName
    Returns
    Type Description
    Widget

    ImportScene2D(string, AssetManager)

    Loads the given scene file into this scene

    Declaration
    public void ImportScene2D(string filename, AssetManager assetManager)
    Parameters
    Type Name Description
    string filename

    The file name

    AssetManager assetManager

    The asset manager

    Init(Game, IRenderDevice)

    Initial the scene

    Declaration
    public virtual void Init(Game game, IRenderDevice renderDevice)
    Parameters
    Type Name Description
    Game game
    IRenderDevice renderDevice

    OnDestroy(Game)

    Destroys the scene data

    Declaration
    public virtual void OnDestroy(Game game)
    Parameters
    Type Name Description
    Game game

    OnRender(Game, IRenderDevice)

    Renders the scene

    Declaration
    public virtual void OnRender(Game game, IRenderDevice renderDevice)
    Parameters
    Type Name Description
    Game game
    IRenderDevice renderDevice

    OnUpdate(Game, IRenderDevice)

    Update the scene and the elements. Called every frame

    Declaration
    public virtual void OnUpdate(Game game, IRenderDevice renderDevice)
    Parameters
    Type Name Description
    Game game
    IRenderDevice renderDevice

    RemoveCanvas(Canvas)

    Removes the ui canvas from the scene

    Declaration
    public void RemoveCanvas(Canvas canvas)
    Parameters
    Type Name Description
    Canvas canvas

    RemoveCanvas(string)

    Removes the ui canvas with the given name from the scene

    Declaration
    public void RemoveCanvas(string canvasName)
    Parameters
    Type Name Description
    string canvasName

    RemoveElement(GameElement)

    Removes a element from the scene. This function will look in all layer for the element.

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

    RemoveElement(string, GameElement)

    Removes a element from the given layer

    Declaration
    public void RemoveElement(string layerName, GameElement element)
    Parameters
    Type Name Description
    string layerName
    GameElement element

    RemoveLayer(Layer)

    Removes a layer from the scene

    Declaration
    public void RemoveLayer(Layer layer)
    Parameters
    Type Name Description
    Layer layer

    ResizeScene(Viewport)

    Resizes the scene by invoking the event handler for scene resize.

    Declaration
    public virtual void ResizeScene(Viewport viewport)
    Parameters
    Type Name Description
    Viewport viewport

    The viewport containing information about the new dimensions.

    In this article
    Back to top Generated by DocFX