SpriteSheetContent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // SpriteSheetContent.cs
  4. //
  5. // Microsoft Game Technology Group
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System.Collections.Generic;
  11. using Microsoft.Xna.Framework;
  12. using Microsoft.Xna.Framework.Content;
  13. using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
  14. #endregion
  15. namespace SpriteSheetPipeline
  16. {
  17. /// <summary>
  18. /// Build-time type used to hold the output data from the SpriteSheetProcessor.
  19. /// This is serialized into XNB format, then at runtime, the ContentManager
  20. /// loads the data into a SpriteSheet object.
  21. /// </summary>
  22. [ContentSerializerRuntimeType("SpriteSheetRuntime.SpriteSheet, SpriteSheetRuntime")]
  23. public class SpriteSheetContent
  24. {
  25. // Single texture contains many separate sprite images.
  26. public Texture2DContent Texture = new Texture2DContent();
  27. // Remember where in the texture each sprite has been placed.
  28. public List<Rectangle> SpriteRectangles = new List<Rectangle>();
  29. // Store the original sprite filenames, so we can look up sprites by name.
  30. public Dictionary<string, int> SpriteNames = new Dictionary<string, int>();
  31. }
  32. }