2
0

GameResourceFont.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // GameResourceFont.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. using Microsoft.Xna.Framework;
  14. using Microsoft.Xna.Framework.Graphics;
  15. #endregion
  16. namespace RobotGameData.Resource
  17. {
  18. /// <summary>
  19. /// a resource element structure with SpriteFont class.
  20. /// When a font(.spritefont) file is loaded from the resource manager,
  21. /// it gets stored here.
  22. /// </summary>
  23. public class GameResourceFont : GameResourceBase
  24. {
  25. #region Fields
  26. SpriteFont spriteFont = null;
  27. #endregion
  28. #region Properties
  29. public SpriteFont SpriteFont
  30. {
  31. get { return spriteFont; }
  32. }
  33. #endregion
  34. /// <summary>
  35. /// Constructor.
  36. /// </summary>
  37. /// <param name="key">key name</param>
  38. /// <param name="assetName">asset name</param>
  39. /// <param name="resource">sprite font resource</param>
  40. public GameResourceFont(string key, string assetName, SpriteFont resource)
  41. : base(key, assetName)
  42. {
  43. this.spriteFont = resource;
  44. this.resource = (object)this.spriteFont;
  45. }
  46. protected override void Dispose(bool disposing)
  47. {
  48. if (disposing)
  49. {
  50. if (spriteFont != null)
  51. {
  52. spriteFont = null;
  53. }
  54. }
  55. base.Dispose(disposing);
  56. }
  57. }
  58. }