Point.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * The MIT License (MIT)
  3. *
  4. * Copyright (c) 2012-2017 DragonBones team and other contributors
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  7. * this software and associated documentation files (the "Software"), to deal in
  8. * the Software without restriction, including without limitation the rights to
  9. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10. * the Software, and to permit persons to whom the Software is furnished to do so,
  11. * subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all
  14. * copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. namespace DragonBones
  24. {
  25. /// <summary>
  26. /// - The Point object represents a location in a two-dimensional coordinate system.
  27. /// </summary>
  28. /// <version>DragonBones 3.0</version>
  29. /// <language>en_US</language>
  30. /// <summary>
  31. /// - Point 对象表示二维坐标系统中的某个位置。
  32. /// </summary>
  33. /// <version>DragonBones 3.0</version>
  34. /// <language>zh_CN</language>
  35. public class Point
  36. {
  37. /// <summary>
  38. /// - The horizontal coordinate.
  39. /// </summary>
  40. /// <default>0.0</default>
  41. /// <version>DragonBones 3.0</version>
  42. /// <language>en_US</language>
  43. /// <summary>
  44. /// - 该点的水平坐标。
  45. /// </summary>
  46. /// <default>0.0</default>
  47. /// <version>DragonBones 3.0</version>
  48. /// <language>zh_CN</language>
  49. public float x = 0.0f;
  50. /// <summary>
  51. /// - The vertical coordinate.
  52. /// </summary>
  53. /// <default>0.0</default>
  54. /// <version>DragonBones 3.0</version>
  55. /// <language>en_US</language>
  56. /// <summary>
  57. /// - 该点的垂直坐标。
  58. /// </summary>
  59. /// <default>0.0</default>
  60. /// <version>DragonBones 3.0</version>
  61. /// <language>zh_CN</language>
  62. public float y = 0.0f;
  63. /// <summary>
  64. /// - Creates a new point. If you pass no parameters to this method, a point is created at (0,0).
  65. /// </summary>
  66. /// <param name="x">- The horizontal coordinate.</param>
  67. /// <param name="y">- The vertical coordinate.</param>
  68. /// <version>DragonBones 3.0</version>
  69. /// <language>en_US</language>
  70. /// <summary>
  71. /// - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。
  72. /// </summary>
  73. /// <param name="x">- 该对象的x属性值,默认为 0.0。</param>
  74. /// <param name="y">- 该对象的y属性值,默认为 0.0。</param>
  75. /// <version>DragonBones 3.0</version>
  76. /// <language>zh_CN</language>
  77. public Point()
  78. {
  79. }
  80. /// <private/>
  81. public void CopyFrom(Point value)
  82. {
  83. this.x = value.x;
  84. this.y = value.y;
  85. }
  86. /// <private/>
  87. public void Clear()
  88. {
  89. this.x = this.y = 0.0f;
  90. }
  91. }
  92. }