public SpriteSheetAnimator(Sprite targetSprite, TextureAtlas textureAtlas) { _sprite = targetSprite; _textureAtlas = textureAtlas; _animations = new Dictionary<string, SpriteSheetAnimation>(); IsPlaying = true; FramesPerSecond = 15; }
public SpriteSheetAnimator(Sprite sprite, TextureAtlas textureAtlas) { _sprite = sprite; _textureAtlas = textureAtlas; _animations = new Dictionary<string, SpriteSheetAnimation>(); _frameIndex = 0; IsPlaying = true; IsLooping = true; }
public SpriteSheetAnimator(Sprite sprite, IEnumerable<TextureRegion2D> regions) { Sprite = sprite; _frames = new List<TextureRegion2D>(regions); _animations = new Dictionary<string, SpriteSheetAnimation>(); _frameIndex = 0; IsPlaying = true; IsLooping = true; }
public SpriteAnimator(Sprite sprite, TextureAtlas textureAtlas) { Loop = true; Speed = 100; _sprite = sprite; _textureAtlas = textureAtlas; _sprite.TextureRegion = _textureAtlas[_frameIndex]; }
public SpriteSheetAnimator(SpriteSheetAnimationGroup animationGroup, Sprite sprite) { _animationGroup = animationGroup; _frameIndex = 0; Sprite = sprite; IsPlaying = true; IsLooping = true; if (Sprite != null && _animationGroup.Frames.Any()) Sprite.TextureRegion = _animationGroup.Frames.First(); }
public SpriteAnimator(Sprite sprite, TextureAtlas textureAtlas, int framesPerSecond = 60) { IsLooping = true; IsPlaying = true; FramesPerSecond = framesPerSecond; _sprite = sprite; _textureAtlas = textureAtlas; _frameIndex = 0; _nextFrameDelay = 0; _sprite.TextureRegion = _textureAtlas[_frameIndex]; }
public SpriteSheetAnimator(SpriteSheetAnimationGroup animationGroup, Sprite sprite) { _animationGroup = animationGroup; //_frames = new List<TextureRegion2D>(regions); //_animations = new Dictionary<string, SpriteSheetAnimation>(); _frameIndex = 0; Sprite = sprite; IsPlaying = true; IsLooping = true; if (Sprite != null && _animationGroup.Frames.Any()) Sprite.TextureRegion = _animationGroup.Frames.First(); }
public SpriteSheetAnimator(Sprite sprite, TextureAtlas textureAtlas) : this(sprite, textureAtlas.Select(t => t)) { }