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 Terrain2D

    Represents a 2D terrain element.

    Inheritance
    object
    GameElement
    Terrain2D
    Inherited Members
    GameElement.OnUpdate(Game, IRenderDevice)
    GameElement.AddBehavior<T>(T)
    GameElement.AddBehavior(IGameBehavior)
    GameElement.GetBehavior<T>()
    GameElement.GetBehaviors<T>()
    GameElement.AddChild(GameElement)
    GameElement.GetInstance(GameElement)
    GameElement.Name
    GameElement.Tag
    GameElement.Location
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Core.GameElements
    Assembly: Genesis.dll
    Syntax
    public class Terrain2D : GameElement

    Constructors

    Terrain2D(string, Vec3, float, float, float, Texture)

    Initializes a new instance of the Terrain2D class with specified name, location, cell counts, cell size, and texture.

    Declaration
    public Terrain2D(string name, Vec3 location, float cellsX, float cellsY, float cellSize, Texture texture)
    Parameters
    Type Name Description
    string name

    The name of the terrain.

    Vec3 location

    The initial location of the terrain.

    float cellsX

    The number of cells in the X direction.

    float cellsY

    The number of cells in the Y direction.

    float cellSize

    The size of each cell.

    Texture texture

    The texture for the terrain.

    Properties

    CellSize

    Gets or sets the size of each cell.

    Declaration
    public float CellSize { get; set; }
    Property Value
    Type Description
    float

    CellsX

    Gets or sets the number of cells in the X direction.

    Declaration
    public float CellsX { get; set; }
    Property Value
    Type Description
    float

    CellsY

    Gets or sets the number of cells in the Y direction.

    Declaration
    public float CellsY { get; set; }
    Property Value
    Type Description
    float

    Texture

    Gets or sets the texture of the terrain.

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

    Methods

    GetBounds()

    Gets the 2D bounds of the terrain.

    Declaration
    public Rect GetBounds()
    Returns
    Type Description
    Rect

    A rectangular region representing the 2D bounds of the terrain.

    Init(Game, IRenderDevice)

    Initializes the terrain element.

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

    The game instance.

    IRenderDevice renderDevice

    The render device used for rendering.

    Overrides
    GameElement.Init(Game, IRenderDevice)

    OnDestroy(Game)

    Handles cleanup and resource disposal when the terrain is destroyed.

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

    The game instance.

    Overrides
    GameElement.OnDestroy(Game)

    OnRender(Game, IRenderDevice)

    Renders the terrain element.

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

    The game instance.

    IRenderDevice renderDevice

    The render device used for rendering.

    Overrides
    GameElement.OnRender(Game, IRenderDevice)
    In this article
    Back to top Generated by DocFX