Sprite.cs 556 B

1234567891011121314151617181920212223
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. namespace FarseerPhysics.SamplesFramework
  4. {
  5. public struct Sprite
  6. {
  7. public Vector2 Origin;
  8. public Texture2D Texture;
  9. public Sprite(Texture2D texture, Vector2 origin)
  10. {
  11. this.Texture = texture;
  12. this.Origin = origin;
  13. }
  14. public Sprite(Texture2D sprite)
  15. {
  16. Texture = sprite;
  17. Origin = new Vector2(sprite.Width / 2f, sprite.Height / 2f);
  18. }
  19. }
  20. }