Nez.Portable/ECS/Components/Renderables/Sprites/SpriteT.cs
/// <summary>
/// plays the animation at the given index. You can cache the indices by calling animationIndexForAnimationName.
/// </summary>
/// <param name="animationKey">Animation key.</param>
/// <param name="startFrame">Start frame.</param>
plays the animation at the given index. You can cache the indices by calling animationIndexForAnimationName.
plays the animation at the given index . You can cache the indices by calling animationIndexForAnimationName .
public SpriteAnimation play(TEnum animationKey, int startFrame = 0)
        {
            Assert.isTrue(_animations.ContainsKey(animationKey), "Attempted to play an animation that doesnt exist");
            var animation = _animations[animationKey];
            animation.prepareForUse();
            _currentAnimationKey = animationKey;
            _currentAnimation = animation;
            isPlaying = true;
            _isReversed = false;
            currentFrame = startFrame;
            setSubtexture(_currentAnimation.frames[currentFrame]);
            _totalElapsedTime = (float)startFrame * _currentAnimation.secondsPerFrame;
            return animation;
        }
public SpriteAnimation play ( TEnum animationKey , int startFrame = 0 ) { Assert . isTrue ( _animations . ContainsKey ( animationKey ) , " " ) ; var animation = _animations [ animationKey ] ; animation . prepareForUse ( ) ; _currentAnimationKey = animationKey ; _currentAnimation = animation ; isPlaying = true ; _isReversed = false ; currentFrame = startFrame ; setSubtexture ( _currentAnimation . frames [ currentFrame ] ) ; _totalElapsedTime = ( float ) startFrame * _currentAnimation . secondsPerFrame ; return animation ; }
plays the animation at the given index.
plays the animation at the given index .
animationKey
TEnum
None
startFrame
int
None