C# Class Nez.Sprites.SpriteAnimation

houses the information that a SpriteT requires for animation
Show file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
completionBehavior AnimationCompletionBehavior
delay float
frames List
totalDuration float

Public Methods

Method Description
SpriteAnimation ( ) : System.Collections.Generic
SpriteAnimation ( List frames ) : System.Collections.Generic
SpriteAnimation ( Subtexture frame ) : System.Collections.Generic
addFrame ( Subtexture subtexture ) : SpriteAnimation

adds a frame to this animation

addFrames ( List subtextures ) : SpriteAnimation

adds multiple frames to this animation

prepareForUse ( ) : void

called by SpriteT to calculate the secondsPerFrame and totalDuration based on the loop details and frame count

setFps ( float fps ) : SpriteAnimation
setLoop ( bool loop ) : SpriteAnimation
setOrigin ( Vector2 origin ) : SpriteAnimation

sets the origin for all frames in this animation

setPingPong ( bool pingPong ) : SpriteAnimation

Method Details

SpriteAnimation() public method

public SpriteAnimation ( ) : System.Collections.Generic
return System.Collections.Generic

SpriteAnimation() public method

public SpriteAnimation ( List frames ) : System.Collections.Generic
frames List
return System.Collections.Generic

SpriteAnimation() public method

public SpriteAnimation ( Subtexture frame ) : System.Collections.Generic
frame Nez.Textures.Subtexture
return System.Collections.Generic

addFrame() public method

adds a frame to this animation
public addFrame ( Subtexture subtexture ) : SpriteAnimation
subtexture Nez.Textures.Subtexture Subtexture.
return SpriteAnimation

addFrames() public method

adds multiple frames to this animation
public addFrames ( List subtextures ) : SpriteAnimation
subtextures List Subtextures.
return SpriteAnimation

prepareForUse() public method

called by SpriteT to calculate the secondsPerFrame and totalDuration based on the loop details and frame count
public prepareForUse ( ) : void
return void

setFps() public method

public setFps ( float fps ) : SpriteAnimation
fps float
return SpriteAnimation

setLoop() public method

public setLoop ( bool loop ) : SpriteAnimation
loop bool
return SpriteAnimation

setOrigin() public method

sets the origin for all frames in this animation
public setOrigin ( Vector2 origin ) : SpriteAnimation
origin Microsoft.Xna.Framework.Vector2
return SpriteAnimation

setPingPong() public method

public setPingPong ( bool pingPong ) : SpriteAnimation
pingPong bool
return SpriteAnimation

Property Details

completionBehavior public property

public AnimationCompletionBehavior completionBehavior
return AnimationCompletionBehavior

delay public property

public float delay
return float

frames public property

public List frames
return List

totalDuration public property

public float totalDuration
return float