using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using StardustCore.Animations; namespace StardustCore.Animations { /// /// Deals with animated sprites. /// public class AnimatedSprite { /// /// The position of the sprite. /// public Vector2 position; /// /// The animation manager for the sprite. /// public AnimationManager animation; /// /// The name of the sprite. /// public string name; /// /// The draw color for the sprite. /// public Color color; /// /// Constructor. /// public AnimatedSprite() { } /// /// Constructor. /// /// The name of the sprite. /// The position of the sprite. /// The animation manager for the sprite. /// The draw color for the sprite. public AnimatedSprite(string Name, Vector2 Position, AnimationManager Animation, Color DrawColor) { this.position = Position; this.name = Name; this.animation = Animation; this.color = DrawColor; } /// /// Updates the sprite's logic. /// /// public virtual void Update(GameTime Time) { } /// /// Draws the sprite to the screen. /// /// public virtual void draw(SpriteBatch b) { this.draw(b, 1f, 0f); } /// /// Draws the sprite to the screen. /// /// /// /// public virtual void draw(SpriteBatch b, float scale, float depth) { this.animation.draw(b, this.position, this.color, scale, SpriteEffects.None, depth); } /// /// Draws the sprite to the screen. /// /// /// /// /// public virtual void draw(SpriteBatch b,Vector2 position ,float scale, float depth) { this.animation.draw(b, position, this.color, scale, SpriteEffects.None, depth); } public virtual void draw(SpriteBatch b, Vector2 position, float scale,float rotation ,float depth) { this.animation.draw(b, position, this.color, scale, rotation,SpriteEffects.None, depth); } /// /// Draws the sprite to the screen. /// /// /// /// /// public virtual void draw(SpriteBatch b, Vector2 position, Vector2 scale, float depth) { this.animation.draw(b, position, this.color, scale, SpriteEffects.None, depth); } } }