@vpmedia/phaser 1.95.0 → 1.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +9 -9
  3. package/src/phaser/core/animation.js +61 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/cache.js +154 -154
  6. package/src/phaser/core/device.js +2 -1
  7. package/src/phaser/core/device_util.js +27 -27
  8. package/src/phaser/core/dom.js +43 -43
  9. package/src/phaser/core/event_manager.js +63 -63
  10. package/src/phaser/core/factory.js +47 -47
  11. package/src/phaser/core/frame.js +30 -30
  12. package/src/phaser/core/frame_data.js +30 -28
  13. package/src/phaser/core/frame_util.js +8 -8
  14. package/src/phaser/core/game.js +34 -18
  15. package/src/phaser/core/loader.js +170 -170
  16. package/src/phaser/core/loader_parser.js +22 -22
  17. package/src/phaser/core/raf.js +1 -1
  18. package/src/phaser/core/scene.js +16 -10
  19. package/src/phaser/core/scene_manager.js +51 -43
  20. package/src/phaser/core/signal.js +56 -52
  21. package/src/phaser/core/sound.js +54 -54
  22. package/src/phaser/core/sound_manager.js +49 -49
  23. package/src/phaser/core/stage.js +16 -16
  24. package/src/phaser/core/time.js +30 -30
  25. package/src/phaser/core/timer.js +64 -64
  26. package/src/phaser/core/timer_event.js +9 -9
  27. package/src/phaser/core/tween.js +90 -90
  28. package/src/phaser/core/tween_data.js +30 -30
  29. package/src/phaser/core/tween_manager.js +29 -24
  30. package/src/phaser/core/world.js +4 -3
  31. package/src/phaser/display/bitmap_text.js +61 -54
  32. package/src/phaser/display/button.js +48 -47
  33. package/src/phaser/display/canvas/buffer.js +8 -8
  34. package/src/phaser/display/canvas/graphics.js +8 -8
  35. package/src/phaser/display/canvas/masker.js +5 -5
  36. package/src/phaser/display/canvas/pool.js +18 -18
  37. package/src/phaser/display/canvas/renderer.js +16 -16
  38. package/src/phaser/display/canvas/tinter.js +22 -22
  39. package/src/phaser/display/canvas/util.js +42 -42
  40. package/src/phaser/display/display_object.js +119 -108
  41. package/src/phaser/display/graphics.js +112 -112
  42. package/src/phaser/display/graphics_data.js +10 -10
  43. package/src/phaser/display/graphics_data_util.js +3 -3
  44. package/src/phaser/display/group.js +50 -50
  45. package/src/phaser/display/image.js +54 -50
  46. package/src/phaser/display/sprite_batch.js +2 -2
  47. package/src/phaser/display/sprite_util.js +19 -19
  48. package/src/phaser/display/text.js +212 -187
  49. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  50. package/src/phaser/display/webgl/base_texture.js +9 -9
  51. package/src/phaser/display/webgl/blend_manager.js +7 -7
  52. package/src/phaser/display/webgl/earcut.js +95 -95
  53. package/src/phaser/display/webgl/earcut_node.js +4 -4
  54. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  55. package/src/phaser/display/webgl/filter_manager.js +9 -9
  56. package/src/phaser/display/webgl/filter_texture.js +10 -10
  57. package/src/phaser/display/webgl/graphics.js +37 -37
  58. package/src/phaser/display/webgl/graphics_data.js +4 -4
  59. package/src/phaser/display/webgl/mask_manager.js +6 -6
  60. package/src/phaser/display/webgl/render_texture.js +16 -16
  61. package/src/phaser/display/webgl/renderer.js +20 -20
  62. package/src/phaser/display/webgl/shader/complex.js +4 -4
  63. package/src/phaser/display/webgl/shader/fast.js +4 -4
  64. package/src/phaser/display/webgl/shader/normal.js +8 -8
  65. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  66. package/src/phaser/display/webgl/shader/strip.js +4 -4
  67. package/src/phaser/display/webgl/shader_manager.js +9 -9
  68. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  69. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  70. package/src/phaser/display/webgl/texture.js +13 -13
  71. package/src/phaser/display/webgl/texture_util.js +8 -8
  72. package/src/phaser/display/webgl/util.js +25 -25
  73. package/src/phaser/geom/circle.js +69 -69
  74. package/src/phaser/geom/ellipse.js +28 -28
  75. package/src/phaser/geom/line.js +93 -93
  76. package/src/phaser/geom/matrix.js +54 -54
  77. package/src/phaser/geom/point.js +96 -96
  78. package/src/phaser/geom/polygon.js +22 -22
  79. package/src/phaser/geom/rectangle.js +132 -132
  80. package/src/phaser/geom/rounded_rectangle.js +12 -12
  81. package/src/phaser/geom/util/circle.js +33 -33
  82. package/src/phaser/geom/util/ellipse.js +5 -5
  83. package/src/phaser/geom/util/line.js +26 -26
  84. package/src/phaser/geom/util/matrix.js +8 -8
  85. package/src/phaser/geom/util/point.js +97 -97
  86. package/src/phaser/geom/util/polygon.js +4 -4
  87. package/src/phaser/geom/util/rectangle.js +74 -74
  88. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  89. package/src/phaser/util/math.js +81 -81
  90. package/types/phaser/core/animation.d.ts +61 -56
  91. package/types/phaser/core/animation.d.ts.map +1 -1
  92. package/types/phaser/core/animation_manager.d.ts +55 -55
  93. package/types/phaser/core/cache.d.ts +154 -154
  94. package/types/phaser/core/device.d.ts.map +1 -1
  95. package/types/phaser/core/dom.d.ts +43 -43
  96. package/types/phaser/core/event_manager.d.ts +63 -63
  97. package/types/phaser/core/factory.d.ts +47 -47
  98. package/types/phaser/core/frame.d.ts +30 -30
  99. package/types/phaser/core/frame_data.d.ts +28 -27
  100. package/types/phaser/core/frame_data.d.ts.map +1 -1
  101. package/types/phaser/core/game.d.ts +52 -19
  102. package/types/phaser/core/game.d.ts.map +1 -1
  103. package/types/phaser/core/loader.d.ts +170 -170
  104. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  105. package/types/phaser/core/raf.d.ts +1 -1
  106. package/types/phaser/core/scene.d.ts +15 -9
  107. package/types/phaser/core/scene.d.ts.map +1 -1
  108. package/types/phaser/core/scene_manager.d.ts +51 -43
  109. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  110. package/types/phaser/core/signal.d.ts +54 -51
  111. package/types/phaser/core/signal.d.ts.map +1 -1
  112. package/types/phaser/core/sound.d.ts +54 -54
  113. package/types/phaser/core/sound_manager.d.ts +49 -49
  114. package/types/phaser/core/stage.d.ts +10 -10
  115. package/types/phaser/core/time.d.ts +30 -30
  116. package/types/phaser/core/timer.d.ts +64 -64
  117. package/types/phaser/core/timer_event.d.ts +9 -9
  118. package/types/phaser/core/tween.d.ts +90 -90
  119. package/types/phaser/core/tween_data.d.ts +30 -30
  120. package/types/phaser/core/tween_manager.d.ts +29 -24
  121. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  122. package/types/phaser/core/world.d.ts +4 -3
  123. package/types/phaser/core/world.d.ts.map +1 -1
  124. package/types/phaser/display/bitmap_text.d.ts +59 -52
  125. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  126. package/types/phaser/display/button.d.ts +47 -46
  127. package/types/phaser/display/button.d.ts.map +1 -1
  128. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  129. package/types/phaser/display/canvas/renderer.d.ts +16 -16
  130. package/types/phaser/display/display_object.d.ts +119 -108
  131. package/types/phaser/display/display_object.d.ts.map +1 -1
  132. package/types/phaser/display/graphics.d.ts +101 -101
  133. package/types/phaser/display/graphics_data.d.ts +10 -10
  134. package/types/phaser/display/group.d.ts +47 -47
  135. package/types/phaser/display/image.d.ts +42 -40
  136. package/types/phaser/display/image.d.ts.map +1 -1
  137. package/types/phaser/display/text.d.ts +207 -184
  138. package/types/phaser/display/text.d.ts.map +1 -1
  139. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  140. package/types/phaser/display/webgl/base_texture.d.ts +9 -9
  141. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  142. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  143. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  144. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  145. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  146. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  147. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  148. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  149. package/types/phaser/display/webgl/renderer.d.ts +20 -20
  150. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  151. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  152. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  153. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  154. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  155. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  156. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  157. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  158. package/types/phaser/display/webgl/texture.d.ts +12 -12
  159. package/types/phaser/geom/circle.d.ts +69 -69
  160. package/types/phaser/geom/ellipse.d.ts +28 -28
  161. package/types/phaser/geom/line.d.ts +93 -93
  162. package/types/phaser/geom/matrix.d.ts +54 -54
  163. package/types/phaser/geom/point.d.ts +96 -96
  164. package/types/phaser/geom/polygon.d.ts +22 -22
  165. package/types/phaser/geom/rectangle.d.ts +132 -132
  166. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  167. package/pnpm-workspace.yaml +0 -4
@@ -1,9 +1,9 @@
1
1
  export class Circle {
2
2
  /**
3
- * TBD.
4
- * @param {number} x - TBD.
5
- * @param {number} y - TBD.
6
- * @param {number} diameter - TBD.
3
+ * Creates a new Circle instance.
4
+ * @param {number} x - The x coordinate of the center point (default: 0).
5
+ * @param {number} y - The y coordinate of the center point (default: 0).
6
+ * @param {number} diameter - The diameter of the circle (default: 0).
7
7
  */
8
8
  constructor(x?: number, y?: number, diameter?: number);
9
9
  /** @type {number} */
@@ -17,152 +17,152 @@ export class Circle {
17
17
  /** @type {number} */
18
18
  type: number;
19
19
  /**
20
- * TBD.
21
- * @returns {number} TBD.
20
+ * Calculates the circumference of this circle.
21
+ * @returns {number} The circumference of this circle.
22
22
  */
23
23
  circumference(): number;
24
24
  /**
25
- * TBD.
26
- * @param {Point} output - TBD.
27
- * @returns {Point} TBD.
25
+ * Returns a random point within this circle.
26
+ * @param {Point} output - The point to store the result in (optional).
27
+ * @returns {Point} A random point within this circle.
28
28
  */
29
29
  random(output?: Point): Point;
30
30
  /**
31
- * TBD.
32
- * @returns {Rectangle} TBD.
31
+ * Gets the bounding rectangle of this circle.
32
+ * @returns {Rectangle} The bounding rectangle of this circle.
33
33
  */
34
34
  getBounds(): Rectangle;
35
35
  /**
36
- * TBD.
37
- * @param {number} x - TBD.
38
- * @param {number} y - TBD.
39
- * @param {number} diameter - TBD.
40
- * @returns {Circle} TBD.
36
+ * Sets the position and size of this circle to new values.
37
+ * @param {number} x - The new x coordinate of the center point.
38
+ * @param {number} y - The new y coordinate of the center point.
39
+ * @param {number} diameter - The new diameter of the circle.
40
+ * @returns {Circle} This circle instance for chaining.
41
41
  */
42
42
  setTo(x: number, y: number, diameter: number): Circle;
43
43
  /**
44
- * TBD.
45
- * @param {Circle} source - TBD.
46
- * @returns {Circle} TBD.
44
+ * Copies the values from another circle to this circle.
45
+ * @param {Circle} source - The circle to copy values from.
46
+ * @returns {Circle} This circle instance for chaining.
47
47
  */
48
48
  copyFrom(source: Circle): Circle;
49
49
  /**
50
- * TBD.
51
- * @param {Circle} dest - TBD.
52
- * @returns {Circle} TBD.
50
+ * Copies the values of this circle to another circle.
51
+ * @param {Circle} dest - The circle to copy values to.
52
+ * @returns {Circle} The destination circle.
53
53
  */
54
54
  copyTo(dest: Circle): Circle;
55
55
  /**
56
- * TBD.
57
- * @param {Circle} dest - TBD.
58
- * @param {boolean} round - TBD.
59
- * @returns {number} TBD.
56
+ * Calculates the distance between this circle and another circle.
57
+ * @param {Circle} dest - The other circle to calculate the distance to.
58
+ * @param {boolean} round - Whether to round the result (default: false).
59
+ * @returns {number} The distance between the circles.
60
60
  */
61
61
  distance(dest: Circle, round?: boolean): number;
62
62
  /**
63
- * TBD.
64
- * @returns {Circle} TBD.
63
+ * Creates a clone of this circle.
64
+ * @returns {Circle} A new circle with the same values as this one.
65
65
  */
66
66
  clone(): Circle;
67
67
  /**
68
- * TBD.
69
- * @param {number} x - TBD.
70
- * @param {number} y - TBD.
71
- * @returns {boolean} TBD.
68
+ * Checks if the specified point is contained within this circle.
69
+ * @param {number} x - The x coordinate of the point to check.
70
+ * @param {number} y - The y coordinate of the point to check.
71
+ * @returns {boolean} True if the point is contained within this circle, false otherwise.
72
72
  */
73
73
  contains(x: number, y: number): boolean;
74
74
  /**
75
- * TBD.
76
- * @param {number} angle - TBD.
77
- * @param {boolean} asDegrees - TBD.
78
- * @param {Point} out - TBD.
79
- * @returns {Point} TBD.
75
+ * Gets a point at a specific angle on the circumference of this circle.
76
+ * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to get the point for.
77
+ * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
78
+ * @param {Point} out - The point to store the result in (optional).
79
+ * @returns {Point} A point at the specified angle on the circumference of this circle.
80
80
  */
81
81
  circumferencePoint(angle: number, asDegrees: boolean, out: Point): Point;
82
82
  /**
83
- * TBD.
84
- * @param {number} dx - TBD.
85
- * @param {number} dy - TBD.
86
- * @returns {Circle} TBD.
83
+ * Offsets the position of this circle by the specified amounts.
84
+ * @param {number} dx - The amount to offset the x coordinate by.
85
+ * @param {number} dy - The amount to offset the y coordinate by.
86
+ * @returns {Circle} This circle instance for chaining.
87
87
  */
88
88
  offset(dx: number, dy: number): Circle;
89
89
  /**
90
- * TBD.
91
- * @param {Point} point - TBD.
92
- * @returns {Circle} TBD.
90
+ * Offsets the position of this circle by the specified point coordinates.
91
+ * @param {Point} point - The point to offset the circle by.
92
+ * @returns {Circle} This circle instance for chaining.
93
93
  */
94
94
  offsetPoint(point: Point): Circle;
95
95
  /**
96
- * TBD.
97
- * @returns {string} TBD.
96
+ * Returns a string representation of this circle.
97
+ * @returns {string} A string representation of the circle.
98
98
  */
99
99
  toString(): string;
100
100
  /**
101
- * TBD.
101
+ * Sets the diameter of this circle.
102
102
  */
103
103
  set diameter(value: number);
104
104
  /**
105
- * TBD.
106
- * @returns {number} TBD.
105
+ * Gets the diameter of this circle.
106
+ * @returns {number} The diameter of this circle.
107
107
  */
108
108
  get diameter(): number;
109
109
  /**
110
- * TBD.
110
+ * Sets the radius of this circle.
111
111
  */
112
112
  set radius(value: number);
113
113
  /**
114
- * TBD.
115
- * @returns {number} TBD.
114
+ * Gets the radius of this circle.
115
+ * @returns {number} The radius of this circle.
116
116
  */
117
117
  get radius(): number;
118
118
  /**
119
- * TBD.
119
+ * Sets the left coordinate of this circle.
120
120
  */
121
121
  set left(value: number);
122
122
  /**
123
- * TBD.
124
- * @returns {number} TBD.
123
+ * Gets the left coordinate of this circle.
124
+ * @returns {number} The left coordinate of this circle.
125
125
  */
126
126
  get left(): number;
127
127
  /**
128
- * TBD.
128
+ * Sets the right coordinate of this circle.
129
129
  */
130
130
  set right(value: number);
131
131
  /**
132
- * TBD.
133
- * @returns {number} TBD.
132
+ * Gets the right coordinate of this circle.
133
+ * @returns {number} The right coordinate of this circle.
134
134
  */
135
135
  get right(): number;
136
136
  /**
137
- * TBD.
137
+ * Sets the top coordinate of this circle.
138
138
  */
139
139
  set top(value: number);
140
140
  /**
141
- * TBD.
142
- * @returns {number} TBD.
141
+ * Gets the top coordinate of this circle.
142
+ * @returns {number} The top coordinate of this circle.
143
143
  */
144
144
  get top(): number;
145
145
  /**
146
- * TBD.
146
+ * Sets the bottom coordinate of this circle.
147
147
  */
148
148
  set bottom(value: number);
149
149
  /**
150
- * TBD.
151
- * @returns {number} TBD.
150
+ * Gets the bottom coordinate of this circle.
151
+ * @returns {number} The bottom coordinate of this circle.
152
152
  */
153
153
  get bottom(): number;
154
154
  /**
155
- * TBD.
156
- * @returns {number} TBD.
155
+ * Gets the area of this circle.
156
+ * @returns {number} The area of this circle.
157
157
  */
158
158
  get area(): number;
159
159
  /**
160
- * TBD.
160
+ * Sets whether this circle is empty (zero diameter).
161
161
  */
162
162
  set empty(value: boolean);
163
163
  /**
164
- * TBD.
165
- * @returns {boolean} TBD.
164
+ * Checks if this circle is empty (has zero diameter).
165
+ * @returns {boolean} True if the circle is empty, false otherwise.
166
166
  */
167
167
  get empty(): boolean;
168
168
  }
@@ -1,10 +1,10 @@
1
1
  export class Ellipse {
2
2
  /**
3
- * TBD.
4
- * @param {number} x - TBD.
5
- * @param {number} y - TBD.
6
- * @param {number} width - TBD.
7
- * @param {number} height - TBD.
3
+ * Creates a new Ellipse instance.
4
+ * @param {number} x - The x coordinate of the center point (default: 0).
5
+ * @param {number} y - The y coordinate of the center point (default: 0).
6
+ * @param {number} width - The width of the ellipse (default: 0).
7
+ * @param {number} height - The height of the ellipse (default: 0).
8
8
  */
9
9
  constructor(x?: number, y?: number, width?: number, height?: number);
10
10
  /** @type {number} */
@@ -18,47 +18,47 @@ export class Ellipse {
18
18
  /** @type {number} */
19
19
  type: number;
20
20
  /**
21
- * TBD.
22
- * @param {number} x - TBD.
23
- * @param {number} y - TBD.
24
- * @param {number} width - TBD.
25
- * @param {number} height - TBD.
26
- * @returns {Ellipse} TBD.
21
+ * Sets the position and size of this ellipse to new values.
22
+ * @param {number} x - The new x coordinate of the center point.
23
+ * @param {number} y - The new y coordinate of the center point.
24
+ * @param {number} width - The new width of the ellipse.
25
+ * @param {number} height - The new height of the ellipse.
26
+ * @returns {Ellipse} This ellipse instance for chaining.
27
27
  */
28
28
  setTo(x: number, y: number, width: number, height: number): Ellipse;
29
29
  /**
30
- * TBD.
31
- * @returns {Rectangle} TBD.
30
+ * Gets the bounding rectangle of this ellipse.
31
+ * @returns {Rectangle} The bounding rectangle of this ellipse.
32
32
  */
33
33
  getBounds(): Rectangle;
34
34
  /**
35
- * TBD.
36
- * @param {Ellipse} source - TBD.
37
- * @returns {Ellipse} TBD.
35
+ * Copies the values from another ellipse to this ellipse.
36
+ * @param {Ellipse} source - The ellipse to copy values from.
37
+ * @returns {Ellipse} This ellipse instance for chaining.
38
38
  */
39
39
  copyFrom(source: Ellipse): Ellipse;
40
40
  /**
41
- * TBD.
42
- * @param {Ellipse} dest - TBD.
43
- * @returns {Ellipse} TBD.
41
+ * Copies the values of this ellipse to another ellipse.
42
+ * @param {Ellipse} dest - The ellipse to copy values to.
43
+ * @returns {Ellipse} The destination ellipse.
44
44
  */
45
45
  copyTo(dest: Ellipse): Ellipse;
46
46
  /**
47
- * TBD.
48
- * @param {number} x - TBD.
49
- * @param {number} y - TBD.
50
- * @returns {boolean} TBD.
47
+ * Checks if the specified point is contained within this ellipse.
48
+ * @param {number} x - The x coordinate of the point to check.
49
+ * @param {number} y - The y coordinate of the point to check.
50
+ * @returns {boolean} True if the point is contained within this ellipse, false otherwise.
51
51
  */
52
52
  contains(x: number, y: number): boolean;
53
53
  /**
54
- * TBD.
55
- * @param {Point} output - TBD.
56
- * @returns {Point} TBD.
54
+ * Returns a random point within this ellipse.
55
+ * @param {Point} output - The point to store the result in (optional).
56
+ * @returns {Point} A random point within this ellipse.
57
57
  */
58
58
  random(output?: Point): Point;
59
59
  /**
60
- * TBD.
61
- * @returns {string} TBD.
60
+ * Returns a string representation of this ellipse.
61
+ * @returns {string} A string representation of the ellipse.
62
62
  */
63
63
  toString(): string;
64
64
  }
@@ -1,10 +1,10 @@
1
1
  export class Line {
2
2
  /**
3
- * TBD.
4
- * @param {number} x1 - TBD.
5
- * @param {number} y1 - TBD.
6
- * @param {number} x2 - TBD.
7
- * @param {number} y2 - TBD.
3
+ * Creates a new Line instance.
4
+ * @param {number} x1 - The x coordinate of the start point (default: 0).
5
+ * @param {number} y1 - The y coordinate of the start point (default: 0).
6
+ * @param {number} x2 - The x coordinate of the end point (default: 0).
7
+ * @param {number} y2 - The y coordinate of the end point (default: 0).
8
8
  */
9
9
  constructor(x1?: number, y1?: number, x2?: number, y2?: number);
10
10
  /** @type {Point} */
@@ -14,178 +14,178 @@ export class Line {
14
14
  /** @type {number} */
15
15
  type: number;
16
16
  /**
17
- * TBD.
18
- * @param {number} x1 - TBD.
19
- * @param {number} y1 - TBD.
20
- * @param {number} x2 - TBD.
21
- * @param {number} y2 - TBD.
22
- * @returns {Line} TBD.
17
+ * Sets the coordinates of this line to new values.
18
+ * @param {number} x1 - The new x coordinate of the start point.
19
+ * @param {number} y1 - The new y coordinate of the start point.
20
+ * @param {number} x2 - The new x coordinate of the end point.
21
+ * @param {number} y2 - The new y coordinate of the end point.
22
+ * @returns {Line} This line instance for chaining.
23
23
  */
24
24
  setTo(x1: number, y1: number, x2: number, y2: number): Line;
25
25
  /**
26
- * TBD.
27
- * @param {object} startSprite - TBD.
28
- * @param {object} endSprite - TBD.
29
- * @param {boolean} useCenter - TBD.
30
- * @returns {Line} TBD.
26
+ * Sets the coordinates of this line to match the positions of two sprites.
27
+ * @param {object} startSprite - The starting sprite to get the position from.
28
+ * @param {object} endSprite - The ending sprite to get the position from.
29
+ * @param {boolean} useCenter - Whether to use the center of the sprites (default: false).
30
+ * @returns {Line} This line instance for chaining.
31
31
  */
32
32
  fromSprite(startSprite: object, endSprite: object, useCenter?: boolean): Line;
33
33
  /**
34
- * TBD.
35
- * @param {number} x - TBD.
36
- * @param {number} y - TBD.
37
- * @param {number} angle - TBD.
38
- * @param {number} length - TBD.
39
- * @returns {Line} TBD.
34
+ * Sets the coordinates of this line to a point at a specific angle and distance.
35
+ * @param {number} x - The x coordinate of the starting point.
36
+ * @param {number} y - The y coordinate of the starting point.
37
+ * @param {number} angle - The angle in radians to set the line at.
38
+ * @param {number} length - The length of the line.
39
+ * @returns {Line} This line instance for chaining.
40
40
  */
41
41
  fromAngle(x: number, y: number, angle: number, length: number): Line;
42
42
  /**
43
- * TBD.
44
- * @param {number} angle - TBD.
45
- * @param {boolean} asDegrees - TBD.
46
- * @returns {Line} TBD.
43
+ * Rotates this line around its center point by the specified angle.
44
+ * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.
45
+ * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
46
+ * @returns {Line} This line instance for chaining.
47
47
  */
48
48
  rotate(angle: number, asDegrees?: boolean): Line;
49
49
  /**
50
- * TBD.
51
- * @param {number} x - TBD.
52
- * @param {number} y - TBD.
53
- * @param {number} angle - TBD.
54
- * @param {boolean} asDegrees - TBD.
55
- * @returns {Line} TBD.
50
+ * Rotates this line around a specific point by the specified angle.
51
+ * @param {number} x - The x coordinate of the center point to rotate around.
52
+ * @param {number} y - The y coordinate of the center point to rotate around.
53
+ * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.
54
+ * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
55
+ * @returns {Line} This line instance for chaining.
56
56
  */
57
57
  rotateAround(x: number, y: number, angle: number, asDegrees?: boolean): Line;
58
58
  /**
59
- * TBD.
60
- * @param {Line} line - TBD.
61
- * @param {boolean} asSegment - TBD.
62
- * @param {Point} result - TBD.
63
- * @returns {Point} TBD.
59
+ * Checks if this line intersects with another line.
60
+ * @param {Line} line - The other line to check for intersection with.
61
+ * @param {boolean} asSegment - Whether to treat the lines as segments (default: false).
62
+ * @param {Point} result - The point to store the intersection in (optional).
63
+ * @returns {Point} The intersection point, or null if no intersection occurs.
64
64
  */
65
65
  intersects(line: Line, asSegment: boolean, result: Point): Point;
66
66
  /**
67
- * TBD.
68
- * @param {Line} line - TBD.
69
- * @returns {number} TBD.
67
+ * Calculates the reflection of this line off another line.
68
+ * @param {Line} line - The line to reflect off.
69
+ * @returns {number} The angle of reflection in radians.
70
70
  */
71
71
  reflect(line: Line): number;
72
72
  /**
73
- * TBD.
74
- * @param {Point} output - TBD.
75
- * @returns {Point} TBD.
73
+ * Returns the midpoint of this line.
74
+ * @param {Point} output - The point to store the result in (optional).
75
+ * @returns {Point} The midpoint of this line.
76
76
  */
77
77
  midPoint(output?: Point): Point;
78
78
  /**
79
- * TBD.
80
- * @param {number} x - TBD.
81
- * @param {number} y - TBD.
79
+ * Centers this line on the specified point.
80
+ * @param {number} x - The x coordinate to center the line on.
81
+ * @param {number} y - The y coordinate to center the line on.
82
82
  */
83
83
  centerOn(x: number, y: number): void;
84
84
  /**
85
- * TBD.
86
- * @param {number} x - TBD.
87
- * @param {number} y - TBD.
88
- * @returns {boolean} TBD.
85
+ * Checks if the specified point lies on this line (not necessarily on the segment).
86
+ * @param {number} x - The x coordinate of the point to check.
87
+ * @param {number} y - The y coordinate of the point to check.
88
+ * @returns {boolean} True if the point lies on this line, false otherwise.
89
89
  */
90
90
  pointOnLine(x: number, y: number): boolean;
91
91
  /**
92
- * TBD.
93
- * @param {number} x - TBD.
94
- * @param {number} y - TBD.
95
- * @returns {boolean} TBD.
92
+ * Checks if the specified point lies on this line segment.
93
+ * @param {number} x - The x coordinate of the point to check.
94
+ * @param {number} y - The y coordinate of the point to check.
95
+ * @returns {boolean} True if the point lies on this line segment, false otherwise.
96
96
  */
97
97
  pointOnSegment(x: number, y: number): boolean;
98
98
  /**
99
- * TBD.
100
- * @param {Point} output - TBD.
101
- * @returns {Point} TBD.
99
+ * Returns a random point on this line.
100
+ * @param {Point} output - The point to store the result in (optional).
101
+ * @returns {Point} A random point on this line.
102
102
  */
103
103
  random(output?: Point): Point;
104
104
  /**
105
- * TBD.
106
- * @param {number} stepRate - TBD.
107
- * @param {number[][]} results - TBD.
108
- * @returns {number[][]} TBD.
105
+ * Gets coordinates of points along this line at regular intervals.
106
+ * @param {number} stepRate - The interval between points (default: 1).
107
+ * @param {number[][]} results - The array to store the results in (optional).
108
+ * @returns {number[][]} An array of coordinate pairs representing points along this line.
109
109
  */
110
110
  coordinatesOnLine(stepRate?: number, results?: number[][]): number[][];
111
111
  /**
112
- * TBD.
113
- * @returns {Line} TBD.
112
+ * Creates a clone of this line.
113
+ * @returns {Line} A new line with the same values as this one.
114
114
  */
115
115
  clone(): Line;
116
116
  /**
117
- * TBD.
118
- * @returns {number} TBD.
117
+ * Gets the length of this line.
118
+ * @returns {number} The length of this line.
119
119
  */
120
120
  get length(): number;
121
121
  /**
122
- * TBD.
123
- * @returns {number} TBD.
122
+ * Gets the angle of this line in radians.
123
+ * @returns {number} The angle of this line in radians.
124
124
  */
125
125
  get angle(): number;
126
126
  /**
127
- * TBD.
128
- * @returns {number} TBD.
127
+ * Gets the slope of this line.
128
+ * @returns {number} The slope of this line.
129
129
  */
130
130
  get slope(): number;
131
131
  /**
132
- * TBD.
133
- * @returns {number} TBD.
132
+ * Gets the perpendicular slope of this line.
133
+ * @returns {number} The perpendicular slope of this line.
134
134
  */
135
135
  get perpSlope(): number;
136
136
  /**
137
- * TBD.
138
- * @returns {number} TBD.
137
+ * Gets the x coordinate of the leftmost point on this line.
138
+ * @returns {number} The x coordinate of the leftmost point on this line.
139
139
  */
140
140
  get x(): number;
141
141
  /**
142
- * TBD.
143
- * @returns {number} TBD.
142
+ * Gets the y coordinate of the topmost point on this line.
143
+ * @returns {number} The y coordinate of the topmost point on this line.
144
144
  */
145
145
  get y(): number;
146
146
  /**
147
- * TBD.
148
- * @returns {number} TBD.
147
+ * Gets the x coordinate of the leftmost point on this line.
148
+ * @returns {number} The x coordinate of the leftmost point on this line.
149
149
  */
150
150
  get left(): number;
151
151
  /**
152
- * TBD.
153
- * @returns {number} TBD.
152
+ * Gets the x coordinate of the rightmost point on this line.
153
+ * @returns {number} The x coordinate of the rightmost point on this line.
154
154
  */
155
155
  get right(): number;
156
156
  /**
157
- * TBD.
158
- * @returns {number} TBD.
157
+ * Gets the y coordinate of the topmost point on this line.
158
+ * @returns {number} The y coordinate of the topmost point on this line.
159
159
  */
160
160
  get top(): number;
161
161
  /**
162
- * TBD.
163
- * @returns {number} TBD.
162
+ * Gets the y coordinate of the bottommost point on this line.
163
+ * @returns {number} The y coordinate of the bottommost point on this line.
164
164
  */
165
165
  get bottom(): number;
166
166
  /**
167
- * TBD.
168
- * @returns {number} TBD.
167
+ * Gets the width of this line (absolute difference between x coordinates).
168
+ * @returns {number} The width of this line.
169
169
  */
170
170
  get width(): number;
171
171
  /**
172
- * TBD.
173
- * @returns {number} TBD.
172
+ * Gets the height of this line (absolute difference between y coordinates).
173
+ * @returns {number} The height of this line.
174
174
  */
175
175
  get height(): number;
176
176
  /**
177
- * TBD.
178
- * @returns {number} TBD.
177
+ * Gets the normal vector x component of this line (perpendicular to the line).
178
+ * @returns {number} The normal vector x component of this line.
179
179
  */
180
180
  get normalX(): number;
181
181
  /**
182
- * TBD.
183
- * @returns {number} TBD.
182
+ * Gets the normal vector y component of this line (perpendicular to the line).
183
+ * @returns {number} The normal vector y component of this line.
184
184
  */
185
185
  get normalY(): number;
186
186
  /**
187
- * TBD.
188
- * @returns {number} TBD.
187
+ * Gets the angle of the normal vector of this line in radians.
188
+ * @returns {number} The angle of the normal vector of this line in radians.
189
189
  */
190
190
  get normalAngle(): number;
191
191
  }