DrawData.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // DrawData.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 SceneDataLibrary
  17. {
  18. /// <summary>
  19. /// This class manages conversion information for drawing.
  20. /// This class is used to indicate changes of position, rotation, scale, center,
  21. /// and brightness both for pattern objects and pattern group sequences,
  22. /// which are drawing units of Layout.
  23. /// This class also manages default conversion information for these elements.
  24. ///
  25. /// 描画用の変換情報を保持します。
  26. /// Layoutの描画単位である、パターンオブジェクト、パターングループ
  27. /// シーケンス、それぞれに対して、位置・回転・スケール・中心・輝度の変更を
  28. /// 指示する際に使用されます。
  29. /// 上記要素のデフォルトの変換情報の保持もこのクラスを使用します。
  30. /// </summary>
  31. public class DrawData
  32. {
  33. #region Fields
  34. private Point position = new Point(); // Distance
  35. private Color color = Color.White; // Color
  36. private Vector2 scale = new Vector2(1.0f, 1.0f); // Enlargement scale
  37. private Point center = new Point(); // Center of rotation enlargement
  38. private float rotateZ = 0.0f; // Rotation value
  39. #endregion
  40. #region Properties
  41. /// <summary>
  42. /// Obtains and sets the display position.
  43. ///
  44. /// 表示位置を取得設定します。
  45. /// </summary>
  46. public Point Position
  47. {
  48. get
  49. {
  50. return position;
  51. }
  52. set
  53. {
  54. position = value;
  55. }
  56. }
  57. /// <summary>
  58. /// Obtains and sets the display color.
  59. ///
  60. /// 表示色を取得設定します。
  61. /// </summary>
  62. public Color Color
  63. {
  64. get
  65. {
  66. return color;
  67. }
  68. set
  69. {
  70. color = value;
  71. }
  72. }
  73. /// <summary>
  74. /// Obtains and sets the enlargement scale.
  75. ///
  76. /// 拡大率の取得設定を行います。
  77. /// </summary>
  78. public Vector2 Scale
  79. {
  80. get
  81. {
  82. return scale;
  83. }
  84. set
  85. {
  86. scale = value;
  87. }
  88. }
  89. /// <summary>
  90. /// Obtains and sets the center position of rotation enlargement.
  91. ///
  92. /// 回転拡大の中心位置の取得設定を行います。
  93. /// </summary>
  94. public Point Center
  95. {
  96. get
  97. {
  98. return center;
  99. }
  100. set
  101. {
  102. center = value;
  103. }
  104. }
  105. /// <summary>
  106. /// Obtains and sets the rotation value.
  107. ///
  108. /// 回転量の取得設定を行います。
  109. /// </summary>
  110. public float RotateZ
  111. {
  112. get
  113. {
  114. return rotateZ;
  115. }
  116. set
  117. {
  118. rotateZ = value;
  119. }
  120. }
  121. #endregion
  122. /// <summary>
  123. /// Converts the held data to character strings.
  124. ///
  125. /// 保持しているデータを文字列に変換します。
  126. /// </summary>
  127. /// <returns>
  128. /// Converted character string
  129. ///
  130. /// 変換された文字列
  131. /// </returns>
  132. public override string ToString()
  133. {
  134. string value = base.ToString() + "\n";
  135. value += string.Format("Point : {0}\n", position);
  136. value += string.Format("Scale : {0}\n", scale);
  137. value += string.Format("Center : {0}\n", center);
  138. value += string.Format("Rotate : {0}\n", rotateZ);
  139. value += string.Format("Color : {0}\n", color);
  140. return value;
  141. }
  142. }
  143. }