GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class Sprite

    Represents a sprite element in a 2D or 3D environment.

    Inheritance
    object
    GameElement
    Sprite
    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.HasTag(string)
    GameElement.Name
    GameElement.Tag
    GameElement.Location
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    GameElement.CastShadows
    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 Sprite : GameElement

    Constructors

    Sprite(string, Vec3, Vec3, SpriteSheet, int, int)

    Initializes a new instance of the Sprite class.

    Declaration
    public Sprite(string name, Vec3 location, Vec3 size, SpriteSheet spriteSheet, int col, int row)
    Parameters
    Type Name Description
    string name

    The name of the sprite.

    Vec3 location

    The location of the sprite.

    Vec3 size

    The size of the sprite.

    SpriteSheet spriteSheet

    The sprite sheet from which this sprite is sourced.

    int col

    The column index of the sprite in the sprite sheet.

    int row

    The row index of the sprite in the sprite sheet.

    Sprite(string, Vec3, Vec3, Texture)

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

    Declaration
    public Sprite(string name, Vec3 location, Vec3 size, Texture texture)
    Parameters
    Type Name Description
    string name

    The name of the sprite.

    Vec3 location

    The initial location of the sprite.

    Vec3 size

    The size of the sprite.

    Texture texture

    The texture for the sprite.

    Properties

    Color

    Gets or sets the color of the sprite.

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

    OcclusionCulling

    Gets or sets a value indicating whether occlusion culling is enabled for the sprite.

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

    TexCoords

    Gets or sets the texture coordinates of the sprite.

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

    Texture

    Gets or sets the texture of the sprite.

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

    Methods

    CalculateVerticies()

    Calculates the vertex coordinates of the sprite.

    Declaration
    public float[] CalculateVerticies()
    Returns
    Type Description
    float[]

    An array containing the vertex coordinates of the sprite.

    GetBounds2D()

    Gets the 2D bounds of the sprite.

    Declaration
    public Rect GetBounds2D()
    Returns
    Type Description
    Rect

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

    GetCenterLocation()

    Gets the center location of the sprite.

    Declaration
    public Vec3 GetCenterLocation()
    Returns
    Type Description
    Vec3

    The center location of the sprite.

    Init(Game, IRenderDevice)

    Initializes the sprite 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 sprite 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 sprite 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