Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Draw()
- {
- //If the particle is in the screen
- if (0 < position.X + _sprite.Width &&
- 0 < position.Y + _sprite.Height &&
- graphics.GraphicsDevice.DisplayMode.Width >= position.X &&
- graphics.GraphicsDevice.DisplayMode.Height >= position.Y)
- {
- //If the particle's rotation is affected by it's direction
- if (relativeRotation)
- {
- 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);
- }
- else
- {
- 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);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment