// Draws an animated sprite from all it's variables information public void drawAnimatedSprite(AnimatedSprite s) { Rectangle destination = new Rectangle( (int) s.getPosition().X, (int) s.getPosition().Y, s.getFrameWidth(), s.getFrameHeight()); Rectangle source = new Rectangle(s.getFrameWidth() * s.getCurrentHorizontal(), s.getFrameHeight() * s.getCurrentVertical(), s.getFrameWidth(), s.getFrameHeight()); spriteBatch.Draw(s.getTexture(), destination, source, Color.White); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); sprite = new AnimatedSprite(Content.Load<Texture2D>("animZombie"), 50.0f, 50.0f, 51, 108, 250); font = Content.Load<SpriteFont>("basic_font"); particleTexts.Add(Content.Load<Texture2D>("particle")); particleTexts.Add(Content.Load<Texture2D>("particle2")); particleTexts.Add(Content.Load<Texture2D>("particle3")); particleTexts.Add(Content.Load<Texture2D>("particle4")); particleTexts.Add(Content.Load<Texture2D>("particle5")); particleTexts.Add(Content.Load<Texture2D>("particle6")); }