Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    SpriteAnimationSystem Class

    Namespace: Stride.Rendering.Sprites
    Assembly: Stride.Engine.dll

    A system in charge of animating the sprites

    System.Object → DisposeBase → ComponentBase → GameSystemBase → SpriteAnimationSystem
    Derived from SpriteAnimationSystem:

    public class SpriteAnimationSystem : GameSystemBase, IDisposable, ICollectorHolder, IGameSystemBase, IComponent, IReferencable, IUpdateable, IDrawable, IContentable
    Name Description
    Constructors
    SpriteAnimationSystem(IServiceRegistry)

    Creates a new instance of SpriteAnimationSystem and register it in the services.

    Properties
    DefaultFramesPerSecond

    Gets or sets the default sprite animation FPS (Default value = 30 FPS).

    Methods
    Draw(GameTime)
    Initialize()
    Pause(SpriteComponent)

    Pauses the animation of the provided sprite component.

    Play(SpriteComponent, Int32, Int32, AnimationRepeatMode, Single, Boolean)

    Play the sprite animation starting at index startIndex and ending at endIndex.

    Play(SpriteComponent, Int32[], AnimationRepeatMode, Single, Boolean)

    Play the sprite animation defined by the provided sequence of indices.

    Queue(SpriteComponent, Int32, Int32, AnimationRepeatMode, Single)

    Queue the sprite animation starting at index startIndex and ending at endIndex at the end of the animation queue.

    Queue(SpriteComponent, Int32[], AnimationRepeatMode, Single)

    Queue the sprite animation defined by the provided sequence of indices at the end of the animation queue.

    Resume(SpriteComponent)

    Resumes a previously paused animation.

    Stop(SpriteComponent)

    Stops the animation of the provided sprite component.

    | Improve this Doc View Source

    Constructors


    SpriteAnimationSystem(IServiceRegistry)

    Creates a new instance of SpriteAnimationSystem and register it in the services.

    public SpriteAnimationSystem(IServiceRegistry registry)
    Parameters
    Type Name Description
    IServiceRegistry registry
    | Improve this Doc View Source

    Properties


    DefaultFramesPerSecond

    Gets or sets the default sprite animation FPS (Default value = 30 FPS).

    public float DefaultFramesPerSecond { get; set; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Methods


    Draw(GameTime)

    public override void Draw(GameTime gameTime)
    Parameters
    Type Name Description
    GameTime gameTime
    Overrides
    GameSystemBase.Draw(GameTime)

    Initialize()

    public override void Initialize()
    Overrides
    GameSystemBase.Initialize()

    Pause(SpriteComponent)

    Pauses the animation of the provided sprite component.

    public void Pause(SpriteComponent spriteComponent)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    the sprite component to pause


    Play(SpriteComponent, Int32, Int32, AnimationRepeatMode, Single, Boolean)

    Play the sprite animation starting at index startIndex and ending at endIndex.

    public void Play(SpriteComponent spriteComponent, int startIndex, int endIndex, AnimationRepeatMode repeatMode, float framesPerSeconds = 0F, bool clearQueuedAnimations = true)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    The sprite component containing the animation

    System.Int32 startIndex

    The first index of the animation

    System.Int32 endIndex

    The last index of the animation

    AnimationRepeatMode repeatMode

    The value indicating how to loop the animation

    System.Single framesPerSeconds

    The animation speed in frames per second. 0 to use the sprite animation system default speed.

    System.Boolean clearQueuedAnimations

    Indicate if queued animation should be cleared


    Play(SpriteComponent, Int32[], AnimationRepeatMode, Single, Boolean)

    Play the sprite animation defined by the provided sequence of indices.

    public void Play(SpriteComponent spriteComponent, int[] indices, AnimationRepeatMode repeatMode, float framesPerSeconds = 0F, bool clearQueuedAnimations = true)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    The sprite component containing the animation

    System.Int32[] indices

    The sequence of indices defining the sprite animation

    AnimationRepeatMode repeatMode

    The value indicating how to loop the animation

    System.Single framesPerSeconds

    The animation speed in frames per second. 0 to use the sprite animation system default speed.

    System.Boolean clearQueuedAnimations

    Indicate if queued animation should be cleared


    Queue(SpriteComponent, Int32, Int32, AnimationRepeatMode, Single)

    Queue the sprite animation starting at index startIndex and ending at endIndex at the end of the animation queue.

    public void Queue(SpriteComponent spriteComponent, int startIndex, int endIndex, AnimationRepeatMode repeatMode, float framesPerSeconds = 0F)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    The sprite component containing the animation

    System.Int32 startIndex

    The first index of the animation

    System.Int32 endIndex

    The last index of the animation

    AnimationRepeatMode repeatMode

    The value indicating how to loop the animation

    System.Single framesPerSeconds

    The animation speed in frames per second. 0 to use the sprite animation system default speed.


    Queue(SpriteComponent, Int32[], AnimationRepeatMode, Single)

    Queue the sprite animation defined by the provided sequence of indices at the end of the animation queue.

    public void Queue(SpriteComponent spriteComponent, int[] indices, AnimationRepeatMode repeatMode, float framesPerSeconds = 0F)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    The sprite component containing the animation

    System.Int32[] indices

    The sequence of indices defining the sprite animation

    AnimationRepeatMode repeatMode

    The value indicating how to loop the animation

    System.Single framesPerSeconds

    The animation speed in frames per second. 0 to use the sprite animation system default speed.


    Resume(SpriteComponent)

    Resumes a previously paused animation.

    public void Resume(SpriteComponent spriteComponent)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    the sprite component to resume


    Stop(SpriteComponent)

    Stops the animation of the provided sprite component.

    public void Stop(SpriteComponent spriteComponent)
    Parameters
    Type Name Description
    SpriteComponent spriteComponent

    the sprite component to stop


    Inherited Members

    GameSystemBase.Game
    GameSystemBase.Services
    GameSystemBase.Content
    GameSystemBase.GraphicsDevice
    GameSystemBase.DrawOrderChanged
    GameSystemBase.VisibleChanged
    GameSystemBase.BeginDraw()
    GameSystemBase.EndDraw()
    GameSystemBase.Visible
    GameSystemBase.DrawOrder
    GameSystemBase.InitGraphicsDeviceService()
    GameSystemBase.EnabledChanged
    GameSystemBase.UpdateOrderChanged
    GameSystemBase.Update(GameTime)
    GameSystemBase.Enabled
    GameSystemBase.UpdateOrder
    GameSystemBase.OnDrawOrderChanged(Object, EventArgs)
    GameSystemBase.OnUpdateOrderChanged(Object, EventArgs)
    GameSystemBase.IContentable.LoadContent()
    GameSystemBase.IContentable.UnloadContent()
    GameSystemBase.LoadContent()
    GameSystemBase.UnloadContent()
    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.Destroy()
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation