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 AnimationBehavior

    Represents a behavior that enables sprite animations in the Genesis framework.

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

    Constructors

    AnimationBehavior()

    Initializes a new instance of the AnimationBehavior class.

    Declaration
    public AnimationBehavior()

    AnimationBehavior(float, float, long, Texture)

    Initializes a new instance of the AnimationBehavior class with specified parameters.

    Declaration
    public AnimationBehavior(float cells, float rows, long frameTime, Texture animationSheet)
    Parameters
    Type Name Description
    float cells

    The number of cells (frames) in a row in the animation sheet.

    float rows

    The number of rows in the animation sheet.

    long frameTime

    The time in milliseconds between animation frames.

    Texture animationSheet

    The texture containing the animation frames.

    Properties

    AnimationSheet

    Gets or sets the texture containing the animation frames.

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

    Animations

    Gets or sets the list of animations available for this behavior.

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

    Cells

    Gets or sets the number of cells (frames) in a row in the animation sheet.

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

    FrameTime

    Gets or sets the time in milliseconds between animation frames.

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

    Rows

    Gets or sets the number of rows in the animation sheet.

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

    SelectedAnimation

    Gets or sets the currently selected animation.

    Declaration
    public Animation SelectedAnimation { get; set; }
    Property Value
    Type Description
    Animation

    Methods

    AddAnimation(Animation)

    Adds an animation to the list of available animations.

    Declaration
    public void AddAnimation(Animation animation)
    Parameters
    Type Name Description
    Animation animation

    LoadAnimation(string)

    Loads the specified animation by name.

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

    The name of the animation to load.

    OnDestroy(Game, GameElement)

    Called when the game behavior is being destroyed.

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

    The game instance.

    GameElement parent

    The parent game element.

    Overrides
    IGameBehavior.OnDestroy(Game, GameElement)

    OnInit(Game, GameElement)

    Called when the game element is initialized.

    Declaration
    public override void OnInit(Game game, GameElement parent)
    Parameters
    Type Name Description
    Game game
    GameElement parent
    Overrides
    IGameBehavior.OnInit(Game, GameElement)

    OnRender(Game, GameElement)

    Called when the game behavior is rendered.

    Declaration
    public override void OnRender(Game game, GameElement parent)
    Parameters
    Type Name Description
    Game game

    The game instance.

    GameElement parent

    The parent game element.

    Overrides
    IGameBehavior.OnRender(Game, GameElement)

    OnUpdate(Game, GameElement)

    Called when the game element is updated.

    Declaration
    public override void OnUpdate(Game game, GameElement parent)
    Parameters
    Type Name Description
    Game game
    GameElement parent
    Overrides
    IGameBehavior.OnUpdate(Game, GameElement)

    Play()

    Starts playing the animation.

    Declaration
    public void Play()

    Stop()

    Stops playing the animation.

    Declaration
    public void Stop()
    In this article
    Back to top Generated by DocFX