DarkTornado

Draw Particle

Jun 4th, 2011
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1.        public void Draw()
  2.         {
  3.             //If the particle is in the screen
  4.             if (0 < position.X + _sprite.Width &&
  5.                 0 < position.Y + _sprite.Height &&
  6.                 graphics.GraphicsDevice.DisplayMode.Width >= position.X &&
  7.                 graphics.GraphicsDevice.DisplayMode.Height >= position.Y)
  8.             {
  9.                 //If the particle's rotation is affected by it's direction
  10.                 if (relativeRotation)
  11.                 {
  12.                     spriteBatch.Draw(_sprite, new Vector2((int)position.X, (int)position.Y), rect, GetColor(), rotationUpdater.GetValue() + directionUpdater.GetValue(), new Vector2(rect.Width / 2, rect.Height / 2), sizeUpdater.GetValue(), SpriteEffects.None, 0);
  13.                 }
  14.                 else
  15.                 {
  16.                     spriteBatch.Draw(_sprite, new Vector2((int)position.X, (int)position.Y), rect, GetColor(), rotationUpdater.GetValue(), new Vector2(rect.Width / 2, rect.Height / 2), sizeUpdater.GetValue(), SpriteEffects.None, 0);
  17.                 }
  18.             }
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment