@vpmedia/phaser 1.94.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 (205) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/package.json +11 -11
  3. package/src/phaser/core/animation.js +79 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/animation_parser.js +2 -2
  6. package/src/phaser/core/cache.js +154 -154
  7. package/src/phaser/core/device.js +2 -1
  8. package/src/phaser/core/device_util.js +27 -27
  9. package/src/phaser/core/dom.js +43 -43
  10. package/src/phaser/core/event_manager.js +63 -63
  11. package/src/phaser/core/factory.js +47 -47
  12. package/src/phaser/core/frame.js +30 -30
  13. package/src/phaser/core/frame_data.js +30 -28
  14. package/src/phaser/core/frame_util.js +8 -8
  15. package/src/phaser/core/game.js +35 -19
  16. package/src/phaser/core/input_pointer.js +18 -0
  17. package/src/phaser/core/loader.js +171 -171
  18. package/src/phaser/core/loader_parser.js +22 -22
  19. package/src/phaser/core/raf.js +1 -1
  20. package/src/phaser/core/scale_manager.js +3 -2
  21. package/src/phaser/core/scene.js +16 -10
  22. package/src/phaser/core/scene_manager.js +51 -43
  23. package/src/phaser/core/signal.js +56 -52
  24. package/src/phaser/core/sound.js +54 -54
  25. package/src/phaser/core/sound_manager.js +49 -49
  26. package/src/phaser/core/stage.js +16 -16
  27. package/src/phaser/core/time.js +54 -30
  28. package/src/phaser/core/timer.js +82 -64
  29. package/src/phaser/core/timer_event.js +9 -9
  30. package/src/phaser/core/tween.js +106 -90
  31. package/src/phaser/core/tween_data.js +30 -30
  32. package/src/phaser/core/tween_manager.js +32 -24
  33. package/src/phaser/core/world.js +4 -3
  34. package/src/phaser/display/bitmap_text.js +72 -54
  35. package/src/phaser/display/button.js +48 -47
  36. package/src/phaser/display/canvas/buffer.js +8 -8
  37. package/src/phaser/display/canvas/graphics.js +8 -8
  38. package/src/phaser/display/canvas/masker.js +5 -5
  39. package/src/phaser/display/canvas/pool.js +18 -18
  40. package/src/phaser/display/canvas/renderer.js +17 -16
  41. package/src/phaser/display/canvas/tinter.js +22 -22
  42. package/src/phaser/display/canvas/util.js +42 -42
  43. package/src/phaser/display/display_object.js +119 -108
  44. package/src/phaser/display/graphics.js +129 -112
  45. package/src/phaser/display/graphics_data.js +10 -10
  46. package/src/phaser/display/graphics_data_util.js +3 -3
  47. package/src/phaser/display/group.js +63 -50
  48. package/src/phaser/display/image.js +68 -50
  49. package/src/phaser/display/sprite_batch.js +2 -2
  50. package/src/phaser/display/sprite_util.js +19 -19
  51. package/src/phaser/display/text.js +217 -187
  52. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  53. package/src/phaser/display/webgl/base_texture.js +9 -9
  54. package/src/phaser/display/webgl/blend_manager.js +7 -7
  55. package/src/phaser/display/webgl/earcut.js +95 -95
  56. package/src/phaser/display/webgl/earcut_node.js +4 -4
  57. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  58. package/src/phaser/display/webgl/filter_manager.js +9 -9
  59. package/src/phaser/display/webgl/filter_texture.js +10 -10
  60. package/src/phaser/display/webgl/graphics.js +37 -37
  61. package/src/phaser/display/webgl/graphics_data.js +4 -4
  62. package/src/phaser/display/webgl/mask_manager.js +6 -6
  63. package/src/phaser/display/webgl/render_texture.js +16 -16
  64. package/src/phaser/display/webgl/renderer.js +21 -20
  65. package/src/phaser/display/webgl/shader/complex.js +4 -4
  66. package/src/phaser/display/webgl/shader/fast.js +4 -4
  67. package/src/phaser/display/webgl/shader/normal.js +8 -8
  68. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  69. package/src/phaser/display/webgl/shader/strip.js +4 -4
  70. package/src/phaser/display/webgl/shader_manager.js +9 -9
  71. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  72. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  73. package/src/phaser/display/webgl/texture.js +13 -13
  74. package/src/phaser/display/webgl/texture_util.js +8 -8
  75. package/src/phaser/display/webgl/util.js +25 -25
  76. package/src/phaser/geom/circle.js +74 -69
  77. package/src/phaser/geom/ellipse.js +33 -28
  78. package/src/phaser/geom/line.js +96 -93
  79. package/src/phaser/geom/matrix.js +61 -54
  80. package/src/phaser/geom/point.js +99 -96
  81. package/src/phaser/geom/polygon.js +27 -22
  82. package/src/phaser/geom/rectangle.js +137 -132
  83. package/src/phaser/geom/rounded_rectangle.js +12 -12
  84. package/src/phaser/geom/util/circle.js +33 -33
  85. package/src/phaser/geom/util/ellipse.js +5 -5
  86. package/src/phaser/geom/util/line.js +26 -26
  87. package/src/phaser/geom/util/matrix.js +8 -8
  88. package/src/phaser/geom/util/point.js +97 -97
  89. package/src/phaser/geom/util/polygon.js +4 -4
  90. package/src/phaser/geom/util/rectangle.js +74 -74
  91. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  92. package/src/phaser/util/math.js +81 -81
  93. package/types/phaser/core/animation.d.ts +79 -56
  94. package/types/phaser/core/animation.d.ts.map +1 -1
  95. package/types/phaser/core/animation_manager.d.ts +55 -55
  96. package/types/phaser/core/animation_parser.d.ts +3 -2
  97. package/types/phaser/core/animation_parser.d.ts.map +1 -1
  98. package/types/phaser/core/cache.d.ts +154 -154
  99. package/types/phaser/core/device.d.ts.map +1 -1
  100. package/types/phaser/core/dom.d.ts +51 -44
  101. package/types/phaser/core/dom.d.ts.map +1 -1
  102. package/types/phaser/core/event_manager.d.ts +63 -63
  103. package/types/phaser/core/factory.d.ts +47 -47
  104. package/types/phaser/core/frame.d.ts +30 -30
  105. package/types/phaser/core/frame_data.d.ts +28 -27
  106. package/types/phaser/core/frame_data.d.ts.map +1 -1
  107. package/types/phaser/core/game.d.ts +54 -21
  108. package/types/phaser/core/game.d.ts.map +1 -1
  109. package/types/phaser/core/input_pointer.d.ts +18 -0
  110. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  111. package/types/phaser/core/loader.d.ts +175 -172
  112. package/types/phaser/core/loader.d.ts.map +1 -1
  113. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  114. package/types/phaser/core/raf.d.ts +1 -1
  115. package/types/phaser/core/scale_manager.d.ts +6 -5
  116. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  117. package/types/phaser/core/scene.d.ts +15 -9
  118. package/types/phaser/core/scene.d.ts.map +1 -1
  119. package/types/phaser/core/scene_manager.d.ts +51 -43
  120. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  121. package/types/phaser/core/signal.d.ts +54 -51
  122. package/types/phaser/core/signal.d.ts.map +1 -1
  123. package/types/phaser/core/sound.d.ts +54 -54
  124. package/types/phaser/core/sound_manager.d.ts +49 -49
  125. package/types/phaser/core/stage.d.ts +10 -10
  126. package/types/phaser/core/time.d.ts +54 -30
  127. package/types/phaser/core/time.d.ts.map +1 -1
  128. package/types/phaser/core/timer.d.ts +82 -64
  129. package/types/phaser/core/timer.d.ts.map +1 -1
  130. package/types/phaser/core/timer_event.d.ts +9 -9
  131. package/types/phaser/core/tween.d.ts +106 -90
  132. package/types/phaser/core/tween.d.ts.map +1 -1
  133. package/types/phaser/core/tween_data.d.ts +30 -30
  134. package/types/phaser/core/tween_manager.d.ts +35 -67
  135. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  136. package/types/phaser/core/world.d.ts +4 -3
  137. package/types/phaser/core/world.d.ts.map +1 -1
  138. package/types/phaser/display/bitmap_text.d.ts +76 -53
  139. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  140. package/types/phaser/display/button.d.ts +47 -46
  141. package/types/phaser/display/button.d.ts.map +1 -1
  142. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  143. package/types/phaser/display/canvas/graphics.d.ts +3 -3
  144. package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
  145. package/types/phaser/display/canvas/pool.d.ts +6 -3
  146. package/types/phaser/display/canvas/pool.d.ts.map +1 -1
  147. package/types/phaser/display/canvas/renderer.d.ts +18 -17
  148. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  149. package/types/phaser/display/canvas/util.d.ts +6 -6
  150. package/types/phaser/display/canvas/util.d.ts.map +1 -1
  151. package/types/phaser/display/display_object.d.ts +119 -108
  152. package/types/phaser/display/display_object.d.ts.map +1 -1
  153. package/types/phaser/display/graphics.d.ts +118 -102
  154. package/types/phaser/display/graphics.d.ts.map +1 -1
  155. package/types/phaser/display/graphics_data.d.ts +10 -10
  156. package/types/phaser/display/group.d.ts +59 -47
  157. package/types/phaser/display/group.d.ts.map +1 -1
  158. package/types/phaser/display/image.d.ts +58 -45
  159. package/types/phaser/display/image.d.ts.map +1 -1
  160. package/types/phaser/display/text.d.ts +237 -188
  161. package/types/phaser/display/text.d.ts.map +1 -1
  162. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  163. package/types/phaser/display/webgl/base_texture.d.ts +10 -10
  164. package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
  165. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  166. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  167. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  168. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  169. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  170. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  171. package/types/phaser/display/webgl/graphics.d.ts +2 -2
  172. package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
  173. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  174. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  175. package/types/phaser/display/webgl/renderer.d.ts +21 -20
  176. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  177. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  178. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  179. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  180. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  181. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  182. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  183. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  184. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  185. package/types/phaser/display/webgl/texture.d.ts +12 -12
  186. package/types/phaser/display/webgl/texture_util.d.ts +4 -2
  187. package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
  188. package/types/phaser/geom/circle.d.ts +74 -69
  189. package/types/phaser/geom/circle.d.ts.map +1 -1
  190. package/types/phaser/geom/ellipse.d.ts +33 -28
  191. package/types/phaser/geom/ellipse.d.ts.map +1 -1
  192. package/types/phaser/geom/line.d.ts +96 -93
  193. package/types/phaser/geom/line.d.ts.map +1 -1
  194. package/types/phaser/geom/matrix.d.ts +61 -54
  195. package/types/phaser/geom/matrix.d.ts.map +1 -1
  196. package/types/phaser/geom/point.d.ts +99 -96
  197. package/types/phaser/geom/point.d.ts.map +1 -1
  198. package/types/phaser/geom/polygon.d.ts +29 -23
  199. package/types/phaser/geom/polygon.d.ts.map +1 -1
  200. package/types/phaser/geom/rectangle.d.ts +137 -132
  201. package/types/phaser/geom/rectangle.d.ts.map +1 -1
  202. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  203. package/types/phaser/geom/util/point.d.ts +1 -1
  204. package/types/phaser/geom/util/point.d.ts.map +1 -1
  205. package/pnpm-workspace.yaml +0 -4
@@ -1,11 +1,11 @@
1
1
  export class Text extends Image {
2
2
  /**
3
- * TBD.
4
- * @param {import('../core/game.js').Game} game - TBD.
5
- * @param {number} x - TBD.
6
- * @param {number} y - TBD.
7
- * @param {string} text - TBD.
8
- * @param {object} style - TBD.
3
+ * Creates a new Text object.
4
+ * @param {import('../core/game.js').Game} game - The game instance this text belongs to.
5
+ * @param {number} x - The x position of the text.
6
+ * @param {number} y - The y position of the text.
7
+ * @param {string} text - The text content to display.
8
+ * @param {object} style - The style settings for the text.
9
9
  */
10
10
  constructor(game: import("../core/game.js").Game, x: number, y: number, text?: string, style?: object);
11
11
  canvas: HTMLCanvasElement;
@@ -25,416 +25,465 @@ export class Text extends Image {
25
25
  useAdvancedWrap: boolean;
26
26
  _res: any;
27
27
  _text: string;
28
- _fontComponents: any;
28
+ _fontComponents: {
29
+ font: string;
30
+ fontStyle?: string;
31
+ fontVariant?: string;
32
+ fontWeight?: string;
33
+ fontSize?: string;
34
+ fontFamily?: string;
35
+ };
36
+ /** @type {number} */
29
37
  _lineSpacing: number;
38
+ /** @type {number} */
30
39
  _charCount: number;
31
40
  /**
32
- * TBD.
33
- * @param {number} x - TBD.
34
- * @param {number} y - TBD.
35
- * @param {string} color - TBD.
36
- * @param {number} blur - TBD.
37
- * @param {boolean} shadowStroke - TBD.
38
- * @param {boolean} shadowFill - TBD.
39
- * @returns {Text} TBD.
41
+ * Sets the drop shadow properties for this text.
42
+ * @param {number} x - The horizontal offset of the shadow.
43
+ * @param {number} y - The vertical offset of the shadow.
44
+ * @param {string} color - The color of the shadow.
45
+ * @param {number} blur - The blur radius of the shadow.
46
+ * @param {boolean} shadowStroke - Whether to apply the shadow to the stroke.
47
+ * @param {boolean} shadowFill - Whether to apply the shadow to the fill.
48
+ * @returns {Text} This Text object for chaining.
40
49
  */
41
50
  setShadow(x?: number, y?: number, color?: string, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Text;
42
51
  dirty: boolean;
43
52
  /**
44
- * TBD.
45
- * @param {object} style - TBD.
46
- * @param {boolean} update - TBD.
47
- * @returns {Text} TBD.
53
+ * Sets the style properties for this text.
54
+ * @param {object} style - The style settings to apply.
55
+ * @param {boolean} update - Whether to update the text immediately.
56
+ * @returns {Text} This Text object for chaining.
48
57
  */
49
58
  setStyle(style?: object, update?: boolean): Text;
50
59
  /**
51
- * TBD.
60
+ * Updates the text content and renders it to the canvas.
52
61
  */
53
62
  updateText(): void;
54
63
  /**
55
- * TBD.
56
- * @param {string} line - TBD.
57
- * @param {number} x - TBD.
58
- * @param {number} y - TBD.
59
- * @param {boolean} fill - TBD.
64
+ * Renders a tabbed line of text to the canvas.
65
+ * @param {string} line - The line of text to render.
66
+ * @param {number} x - The x position to start rendering from.
67
+ * @param {number} y - The y position to start rendering from.
68
+ * @param {boolean} fill - True to fill the text, false to stroke it.
60
69
  */
61
70
  renderTabLine(line: string, x: number, y: number, fill: boolean): void;
62
71
  /**
63
- * TBD.
64
- * @param {string} state - TBD.
72
+ * Updates the shadow properties for this text.
73
+ * @param {string} state - The shadow state to update ('stroke' or 'fill').
65
74
  */
66
75
  updateShadow(state: string): void;
67
76
  /**
68
- * TBD.
69
- * @param {string} line - TBD.
70
- * @returns {number} TBD.
77
+ * Measures the width of a line of text.
78
+ * @param {string} line - The line of text to measure.
79
+ * @returns {number} The width of the line in pixels.
71
80
  */
72
81
  measureLine(line: string): number;
73
82
  /**
74
- * TBD.
75
- * @param {string} line - TBD.
76
- * @param {number} x - TBD.
77
- * @param {number} y - TBD.
83
+ * Updates a line of text to the canvas.
84
+ * @param {string} line - The line of text to update.
85
+ * @param {number} x - The x position to start updating from.
86
+ * @param {number} y - The y position to start updating from.
78
87
  */
79
88
  updateLine(line: string, x: number, y: number): void;
80
89
  /**
81
- * TBD.
82
- * @returns {Text} TBD.
90
+ * Clears all color values from this text object.
91
+ * @returns {Text} This Text object for chaining.
83
92
  */
84
93
  clearColors(): Text;
85
94
  /**
86
- * TBD.
87
- * @returns {Text} TBD.
95
+ * Clears all font style values from this text object.
96
+ * @returns {Text} This Text object for chaining.
88
97
  */
89
98
  clearFontValues(): Text;
90
99
  /**
91
- * TBD.
92
- * @param {string} color - TBD.
93
- * @param {number} position - TBD.
94
- * @returns {Text} TBD.
100
+ * Adds a color to this text object at the specified position.
101
+ * @param {string} color - The color to apply.
102
+ * @param {number} position - The character position to apply the color at.
103
+ * @returns {Text} This Text object for chaining.
95
104
  */
96
105
  addColor(color: string, position: number): Text;
97
106
  /**
98
- * TBD.
99
- * @param {number} color - TBD.
100
- * @param {number} position - TBD.
101
- * @returns {Text} TBD.
107
+ * Adds a stroke color to this text object at the specified position.
108
+ * @param {number} color - The stroke color to apply.
109
+ * @param {number} position - The character position to apply the stroke color at.
110
+ * @returns {Text} This Text object for chaining.
102
111
  */
103
112
  addStrokeColor(color: number, position: number): Text;
104
113
  /**
105
- * TBD.
106
- * @param {object} style - TBD.
107
- * @param {number} position - TBD.
108
- * @returns {Text} TBD.
114
+ * Adds a font style to this text object at the specified position.
115
+ * @param {object} style - The font style to apply.
116
+ * @param {number} position - The character position to apply the font style at.
117
+ * @returns {Text} This Text object for chaining.
109
118
  */
110
119
  addFontStyle(style: object, position: number): Text;
111
120
  /**
112
- * TBD.
113
- * @param {number} weight - TBD.
114
- * @param {number} position - TBD.
115
- * @returns {Text} TBD.
121
+ * Adds a font weight to this text object at the specified position.
122
+ * @param {number} weight - The font weight to apply.
123
+ * @param {number} position - The character position to apply the font weight at.
124
+ * @returns {Text} This Text object for chaining.
116
125
  */
117
126
  addFontWeight(weight: number, position: number): Text;
118
127
  /**
119
- * TBD.
120
- * @param {string} text - TBD.
121
- * @returns {string[]} TBD.
128
+ * Precalculates word wrap for the given text.
129
+ * @param {string} text - The text to precalculate word wrap for.
130
+ * @returns {string[]} The wrapped lines of text.
122
131
  */
123
132
  precalculateWordWrap(text: string): string[];
124
133
  /**
125
- * TBD.
126
- * @param {string} text - TBD.
127
- * @returns {string} TBD.
134
+ * Runs word wrap on the given text.
135
+ * @param {string} text - The text to run word wrap on.
136
+ * @returns {string} The wrapped text.
128
137
  */
129
138
  runWordWrap(text: string): string;
130
139
  /**
131
- * TBD.
132
- * @param {string} text - TBD.
133
- * @returns {string} TBD.
134
- * @throws {Error}
140
+ * Runs advanced word wrap on the given text.
141
+ * @param {string} text - The text to run advanced word wrap on.
142
+ * @returns {string} The wrapped text.
143
+ * @throws {Error} If the wordWrapWidth setting is less than a single character.
135
144
  */
136
145
  advancedWordWrap(text: string): string;
137
146
  /**
138
- * TBD.
139
- * @param {string} text - TBD.
140
- * @returns {string} TBD.
147
+ * Runs basic word wrap on the given text.
148
+ * @param {string} text - The text to run basic word wrap on.
149
+ * @returns {string} The wrapped text.
141
150
  */
142
151
  basicWordWrap(text: string): string;
143
152
  /**
144
- * TBD.
145
- * @param {object} components - TBD.
153
+ * Updates the font properties based on the given components.
154
+ * @param {object} components - The font components to update from.
146
155
  */
147
156
  updateFont(components: object): void;
148
157
  /**
149
- * TBD.
150
- * @param {string} font - TBD.
151
- * @returns {object} TBD.
158
+ * Converts a font string to components.
159
+ * @param {string} font - The font string to convert.
160
+ * @returns {{ font: string, fontStyle?: string, fontVariant?: string, fontWeight?: string, fontSize?: string, fontFamily?: string }} The font components.
152
161
  */
153
- fontToComponents(font: string): object;
162
+ fontToComponents(font: string): {
163
+ font: string;
164
+ fontStyle?: string;
165
+ fontVariant?: string;
166
+ fontWeight?: string;
167
+ fontSize?: string;
168
+ fontFamily?: string;
169
+ };
154
170
  /**
155
- * TBD.
156
- * @param {object} components - TBD.
157
- * @returns {string} TBD.
171
+ * Converts font components to a font string.
172
+ * @param {object} components - The font components to convert.
173
+ * @returns {string} The font string.
158
174
  */
159
175
  componentsToFont(components: object): string;
160
176
  /**
161
- * TBD.
162
- * @param {string} text - TBD.
163
- * @param {boolean} immediate - TBD.
164
- * @returns {Text} TBD.
177
+ * Sets the text content of this object.
178
+ * @param {string} text - The new text to set.
179
+ * @param {boolean} immediate - If true, updates the text immediately.
180
+ * @returns {Text} This Text object for chaining.
165
181
  */
166
182
  setText(text: string, immediate?: boolean): Text;
167
183
  /**
168
- * TBD.
169
- * @param {string | number | boolean | Date} value - TBD.
184
+ * Sets the text content of this object.
185
+ * @param {string | number | boolean | Date} value - The new text content to set.
170
186
  */
171
187
  set text(value: string | number | boolean | Date);
172
188
  /**
173
- * TBD.
174
- * @returns {string} TBD.
189
+ * Gets the text content of this object.
190
+ * @returns {string} The current text content.
175
191
  */
176
192
  get text(): string;
177
193
  /**
178
- * TBD.
179
- * @param {string[]|string[][]} list - TBD.
180
- * @returns {Text} TBD.
194
+ * Parses a list of text into this object.
195
+ * @param {string[]|string[][]} list - The list of text to parse.
196
+ * @returns {Text} This Text object for chaining.
181
197
  */
182
198
  parseList(list: string[] | string[][]): Text;
183
199
  /**
184
- * TBD.
185
- * @param {number} x - TBD.
186
- * @param {number} y - TBD.
187
- * @param {number} width - TBD.
188
- * @param {number} height - TBD.
189
- * @returns {Text} TBD.
200
+ * Sets the text bounds for this object.
201
+ * @param {number} x - The x position of the bounds.
202
+ * @param {number} y - The y position of the bounds.
203
+ * @param {number} width - The width of the bounds.
204
+ * @param {number} height - The height of the bounds.
205
+ * @returns {Text} This Text object for chaining.
190
206
  */
191
207
  setTextBounds(x: number, y: number, width: number, height: number): Text;
192
208
  /**
193
- * TBD.
209
+ * Updates the texture of this object.
194
210
  */
195
211
  updateTexture(): void;
196
212
  /**
197
- * TBD.
198
- * @param {object} renderSession - TBD.
213
+ * Renders this text object using WebGL.
214
+ * @param {object} renderSession - The render session to use.
199
215
  */
200
216
  renderWebGL(renderSession: object): void;
201
217
  /**
202
- * TBD.
203
- * @param {object} renderSession - TBD.
218
+ * Renders this text object using Canvas.
219
+ * @param {object} renderSession - The render session to use.
204
220
  */
205
221
  renderCanvas(renderSession: object): void;
206
222
  /**
207
- * TBD.
208
- * @returns {object} TBD.
223
+ * Gets the font properties cache object.
224
+ * @returns {{[key: string]: {ascent: number, descent: number, fontSize: number}}} The font properties cache.
209
225
  */
210
- getFontPropertiesCache(): object;
226
+ getFontPropertiesCache(): {
227
+ [key: string]: {
228
+ ascent: number;
229
+ descent: number;
230
+ fontSize: number;
231
+ };
232
+ };
211
233
  /**
212
- * TBD.
213
- * @returns {HTMLCanvasElement} TBD.
234
+ * Gets the font properties canvas element.
235
+ * @returns {HTMLCanvasElement} The font properties canvas element.
214
236
  */
215
237
  getFontPropertiesCanvas(): HTMLCanvasElement;
216
238
  /**
217
- * TBD.
218
- * @returns {CanvasRenderingContext2D} TBD.
239
+ * Gets the font properties canvas context.
240
+ * @returns {CanvasRenderingContext2D} The font properties canvas context.
219
241
  */
220
242
  getFontPropertiesContext(): CanvasRenderingContext2D;
221
243
  /**
222
- * TBD.
223
- * @param {string} font - TBD.
224
- * @returns {object} TBD.
244
+ * Determines the font properties for a given font.
245
+ * @param {string} font - The font to determine properties for.
246
+ * @returns {object} The font properties.
225
247
  */
226
248
  determineFontProperties(font: string): object;
227
249
  /**
228
- * TBD.
229
- * @param {string} fontStyle - TBD.
230
- * @returns {object} TBD.
250
+ * Determines font properties using a fallback method.
251
+ * @param {string} fontStyle - The font style to determine properties for.
252
+ * @returns {{ascent: number, descent: number, fontSize: number}} The font properties.
231
253
  */
232
- determineFontPropertiesFallback(fontStyle: string): object;
254
+ determineFontPropertiesFallback(fontStyle: string): {
255
+ ascent: number;
256
+ descent: number;
257
+ fontSize: number;
258
+ };
233
259
  /**
234
- * TBD.
260
+ * Sets the CSS font string for this object.
261
+ * @param {string} value - The new CSS font string to set.
235
262
  */
236
263
  set cssFont(value: string);
237
264
  /**
238
- * TBD.
239
- * @returns {string} TBD.
265
+ * Gets the CSS font string for this object.
266
+ * @returns {string} The CSS font string.
240
267
  */
241
268
  get cssFont(): string;
242
269
  /**
243
- * TBD.
270
+ * Sets the font family of this object.
271
+ * @param {string} value - The new font family to set.
244
272
  */
245
- set font(value: number);
273
+ set font(value: string);
246
274
  /**
247
- * TBD.
248
- * @returns {number} TBD.
275
+ * Gets the font family of this object.
276
+ * @returns {number} The font family.
249
277
  */
250
278
  get font(): number;
251
279
  /**
252
- * TBD.
280
+ * Sets the font size of this object.
281
+ * @param {number} value - The new font size to set.
253
282
  */
254
283
  set fontSize(value: number);
255
284
  /**
256
- * TBD.
257
- * @returns {number} TBD.
285
+ * Gets the font size of this object.
286
+ * @returns {number} The font size.
258
287
  */
259
288
  get fontSize(): number;
260
289
  /**
261
- * TBD.
290
+ * Sets the font weight of this object.
291
+ * @param {string} value - The new font weight to set.
262
292
  */
263
293
  set fontWeight(value: string);
264
294
  /**
265
- * TBD.
266
- * @returns {string} TBD.
295
+ * Gets the font weight of this object.
296
+ * @returns {string} The font weight.
267
297
  */
268
298
  get fontWeight(): string;
269
299
  /**
270
- * TBD.
300
+ * Sets the font style of this object.
301
+ * @param {string} value - The new font style to set.
271
302
  */
272
303
  set fontStyle(value: string);
273
304
  /**
274
- * TBD.
275
- * @returns {string} TBD.
305
+ * Gets the font style of this object.
306
+ * @returns {string} The font style.
276
307
  */
277
308
  get fontStyle(): string;
278
309
  /**
279
- * TBD.
310
+ * Sets the font variant of this object.
311
+ * @param {string} value - The new font variant to set.
280
312
  */
281
313
  set fontVariant(value: string);
282
314
  /**
283
- * TBD.
284
- * @returns {string} TBD.
315
+ * Gets the font variant of this object.
316
+ * @returns {string} The font variant.
285
317
  */
286
318
  get fontVariant(): string;
287
319
  /**
288
- * TBD.
320
+ * Sets the fill color of this object.
321
+ * @param {string} value - The new fill color to set.
289
322
  */
290
- set fill(value: number);
323
+ set fill(value: string);
291
324
  /**
292
- * TBD.
293
- * @returns {number} TBD.
325
+ * Gets the fill color of this object.
326
+ * @returns {number} The fill color.
294
327
  */
295
328
  get fill(): number;
296
329
  /**
297
- * TBD.
330
+ * Sets the alignment of this object.
331
+ * @param {string} value - The new text alignment to set.
298
332
  */
299
333
  set align(value: string);
300
334
  /**
301
- * TBD.
302
- * @returns {string} TBD.
335
+ * Gets the alignment of this object.
336
+ * @returns {string} The text alignment.
303
337
  */
304
338
  get align(): string;
305
339
  /**
306
- * TBD.
340
+ * Sets the resolution of this object.
341
+ * @param {number} value - The new resolution to set.
307
342
  */
308
343
  set resolution(value: number);
309
344
  /**
310
- * TBD.
311
- * @returns {number} TBD.
345
+ * Gets the resolution of this object.
346
+ * @returns {number} The resolution.
312
347
  */
313
348
  get resolution(): number;
314
349
  /**
315
- * TBD.
350
+ * Sets the tabs setting of this object.
351
+ * @param {number} value - The new tabs setting to set.
316
352
  */
317
353
  set tabs(value: number);
318
354
  /**
319
- * TBD.
320
- * @returns {number} TBD.
355
+ * Gets the tabs setting of this object.
356
+ * @returns {number} The tabs setting.
321
357
  */
322
358
  get tabs(): number;
323
359
  /**
324
- * TBD.
360
+ * Sets the horizontal bounds alignment of this object.
361
+ * @param {number} value - The new horizontal bounds alignment to set.
325
362
  */
326
363
  set boundsAlignH(value: number);
327
364
  /**
328
- * TBD.
329
- * @returns {number} TBD.
365
+ * Gets the horizontal bounds alignment of this object.
366
+ * @returns {number} The horizontal bounds alignment.
330
367
  */
331
368
  get boundsAlignH(): number;
332
369
  /**
333
- * TBD.
370
+ * Sets the vertical bounds alignment of this object.
371
+ * @param {number} value - The new vertical bounds alignment to set.
334
372
  */
335
373
  set boundsAlignV(value: number);
336
374
  /**
337
- * TBD.
338
- * @returns {number} TBD.
375
+ * Gets the vertical bounds alignment of this object.
376
+ * @returns {number} The vertical bounds alignment.
339
377
  */
340
378
  get boundsAlignV(): number;
341
379
  /**
342
- * TBD.
380
+ * Sets the stroke color of this object.
381
+ * @param {string} value - The new stroke color to set.
343
382
  */
344
- set stroke(value: number);
383
+ set stroke(value: string);
345
384
  /**
346
- * TBD.
347
- * @returns {number} TBD.
385
+ * Gets the stroke color of this object.
386
+ * @returns {number} The stroke color.
348
387
  */
349
388
  get stroke(): number;
350
389
  /**
351
- * TBD.
390
+ * Sets the stroke thickness of this object.
391
+ * @param {number} value - The new stroke thickness to set.
352
392
  */
353
393
  set strokeThickness(value: number);
354
394
  /**
355
- * TBD.
356
- * @returns {number} TBD.
395
+ * Gets the stroke thickness of this object.
396
+ * @returns {number} The stroke thickness.
357
397
  */
358
398
  get strokeThickness(): number;
359
399
  /**
360
- * TBD.
400
+ * Sets the word wrap setting of this object.
401
+ * @param {boolean} value - The new word wrap setting to set.
361
402
  */
362
- set wordWrap(value: number);
403
+ set wordWrap(value: boolean);
363
404
  /**
364
- * TBD.
365
- * @returns {number} TBD.
405
+ * Gets the word wrap setting of this object.
406
+ * @returns {number} The word wrap setting.
366
407
  */
367
408
  get wordWrap(): number;
368
409
  /**
369
- * TBD.
410
+ * Sets the word wrap width of this object.
411
+ * @param {number} value - The new word wrap width to set.
370
412
  */
371
413
  set wordWrapWidth(value: number);
372
414
  /**
373
- * TBD.
374
- * @returns {number} TBD.
415
+ * Gets the word wrap width of this object.
416
+ * @returns {number} The word wrap width.
375
417
  */
376
418
  get wordWrapWidth(): number;
377
419
  /**
378
- * TBD.
420
+ * Sets the line spacing of this object.
421
+ * @param {number} value - The new line spacing to set.
379
422
  */
380
423
  set lineSpacing(value: number);
381
424
  /**
382
- * TBD.
383
- * @returns {number} TBD.
425
+ * Gets the line spacing of this object.
426
+ * @returns {number} The line spacing.
384
427
  */
385
428
  get lineSpacing(): number;
386
429
  /**
387
- * TBD.
430
+ * Sets the shadow offset X of this object.
431
+ * @param {number} value - The new shadow offset X to set.
388
432
  */
389
433
  set shadowOffsetX(value: number);
390
434
  /**
391
- * TBD.
392
- * @returns {number} TBD.
435
+ * Gets the shadow offset X of this object.
436
+ * @returns {number} The shadow offset X.
393
437
  */
394
438
  get shadowOffsetX(): number;
395
439
  /**
396
- * TBD.
440
+ * Sets the shadow offset Y of this object.
441
+ * @param {number} value - The new shadow offset Y to set.
397
442
  */
398
443
  set shadowOffsetY(value: number);
399
444
  /**
400
- * TBD.
401
- * @returns {number} TBD.
445
+ * Gets the shadow offset Y of this object.
446
+ * @returns {number} The shadow offset Y.
402
447
  */
403
448
  get shadowOffsetY(): number;
404
449
  /**
405
- * TBD.
450
+ * Sets the shadow color of this object.
451
+ * @param {string} value - The new shadow color to set.
406
452
  */
407
- set shadowColor(value: number);
453
+ set shadowColor(value: string);
408
454
  /**
409
- * TBD.
410
- * @returns {number} TBD.
455
+ * Gets the shadow color of this object.
456
+ * @returns {number} The shadow color.
411
457
  */
412
458
  get shadowColor(): number;
413
459
  /**
414
- * TBD.
460
+ * Sets the shadow blur of this object.
461
+ * @param {number} value - The new shadow blur to set.
415
462
  */
416
463
  set shadowBlur(value: number);
417
464
  /**
418
- * TBD.
419
- * @returns {number} TBD.
465
+ * Gets the shadow blur of this object.
466
+ * @returns {number} The shadow blur.
420
467
  */
421
468
  get shadowBlur(): number;
422
469
  /**
423
- * TBD.
470
+ * Sets the shadow stroke setting of this object.
471
+ * @param {boolean} value - The new shadow stroke setting to set.
424
472
  */
425
- set shadowStroke(value: number);
473
+ set shadowStroke(value: boolean);
426
474
  /**
427
- * TBD.
428
- * @returns {number} TBD.
475
+ * Gets the shadow stroke setting of this object.
476
+ * @returns {number} The shadow stroke setting.
429
477
  */
430
478
  get shadowStroke(): number;
431
479
  /**
432
- * TBD.
480
+ * Sets the shadow fill setting of this object.
481
+ * @param {boolean} value - The new shadow fill setting to set.
433
482
  */
434
- set shadowFill(value: number);
483
+ set shadowFill(value: boolean);
435
484
  /**
436
- * TBD.
437
- * @returns {number} TBD.
485
+ * Gets the shadow fill setting of this object.
486
+ * @returns {number} The shadow fill setting.
438
487
  */
439
488
  get shadowFill(): number;
440
489
  }