@vpmedia/phaser 1.15.0 → 1.16.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.
- package/README.md +3 -3
- package/package.json +6 -5
- package/src/index.js +15 -18
- package/src/phaser/core/animation.js +102 -6
- package/src/phaser/core/animation_manager.js +88 -10
- package/src/phaser/core/animation_parser.js +5 -18
- package/src/phaser/core/array_set.js +51 -5
- package/src/phaser/core/cache.js +291 -6
- package/src/phaser/core/const.js +107 -4
- package/src/phaser/core/device.js +3 -6
- package/src/phaser/core/device_util.js +3 -16
- package/src/phaser/core/dom.js +127 -29
- package/src/phaser/core/event_manager.js +128 -6
- package/src/phaser/core/factory.js +69 -34
- package/src/phaser/core/frame.js +43 -6
- package/src/phaser/core/frame_data.js +55 -5
- package/src/phaser/core/frame_util.js +7 -12
- package/src/phaser/core/game.js +35 -7
- package/src/phaser/core/input.js +116 -17
- package/src/phaser/core/input_handler.js +242 -42
- package/src/phaser/core/input_mouse.js +66 -5
- package/src/phaser/core/input_mspointer.js +40 -9
- package/src/phaser/core/input_pointer.js +79 -17
- package/src/phaser/core/input_touch.js +42 -5
- package/src/phaser/core/loader.js +274 -101
- package/src/phaser/core/loader_parser.js +2 -10
- package/src/phaser/core/raf.js +16 -5
- package/src/phaser/core/scale_manager.js +204 -39
- package/src/phaser/core/scene.js +24 -5
- package/src/phaser/core/scene_manager.js +81 -11
- package/src/phaser/core/signal.js +88 -11
- package/src/phaser/core/signal_binding.js +35 -15
- package/src/phaser/core/sound.js +99 -10
- package/src/phaser/core/sound_manager.js +89 -13
- package/src/phaser/core/sound_sprite.js +20 -5
- package/src/phaser/core/stage.js +43 -7
- package/src/phaser/core/time.js +67 -5
- package/src/phaser/core/timer.js +107 -30
- package/src/phaser/core/timer_event.js +11 -6
- package/src/phaser/core/tween.js +124 -30
- package/src/phaser/core/tween_data.js +42 -18
- package/src/phaser/core/tween_easing.js +1 -8
- package/src/phaser/core/tween_manager.js +47 -5
- package/src/phaser/core/world.js +9 -6
- package/src/phaser/display/bitmap_text.js +91 -10
- package/src/phaser/display/button.js +63 -12
- package/src/phaser/display/canvas/buffer.js +16 -6
- package/src/phaser/display/canvas/graphics.js +1 -13
- package/src/phaser/display/canvas/masker.js +0 -6
- package/src/phaser/display/canvas/pool.js +0 -7
- package/src/phaser/display/canvas/renderer.js +28 -8
- package/src/phaser/display/canvas/tinter.js +4 -43
- package/src/phaser/display/canvas/util.js +0 -6
- package/src/phaser/display/display_object.js +192 -20
- package/src/phaser/display/graphics.js +161 -26
- package/src/phaser/display/graphics_data.js +14 -6
- package/src/phaser/display/graphics_data_util.js +2 -8
- package/src/phaser/display/group.js +74 -9
- package/src/phaser/display/image.js +85 -9
- package/src/phaser/display/sprite_batch.js +3 -8
- package/src/phaser/display/sprite_util.js +3 -23
- package/src/phaser/display/text.js +331 -31
- package/src/phaser/display/webgl/abstract_filter.js +8 -7
- package/src/phaser/display/webgl/base_texture.js +20 -12
- package/src/phaser/display/webgl/blend_manager.js +14 -7
- package/src/phaser/display/webgl/earcut.js +4 -23
- package/src/phaser/display/webgl/earcut_node.js +6 -7
- package/src/phaser/display/webgl/fast_sprite_batch.js +34 -11
- package/src/phaser/display/webgl/filter_manager.js +25 -7
- package/src/phaser/display/webgl/filter_texture.js +21 -22
- package/src/phaser/display/webgl/graphics.js +5 -28
- package/src/phaser/display/webgl/graphics_data.js +10 -7
- package/src/phaser/display/webgl/mask_manager.js +0 -6
- package/src/phaser/display/webgl/render_texture.js +33 -21
- package/src/phaser/display/webgl/renderer.js +38 -11
- package/src/phaser/display/webgl/shader/complex.js +10 -6
- package/src/phaser/display/webgl/shader/fast.js +10 -6
- package/src/phaser/display/webgl/shader/normal.js +23 -32
- package/src/phaser/display/webgl/shader/primitive.js +10 -6
- package/src/phaser/display/webgl/shader/strip.js +10 -6
- package/src/phaser/display/webgl/shader_manager.js +18 -6
- package/src/phaser/display/webgl/sprite_batch.js +41 -8
- package/src/phaser/display/webgl/stencil_manager.js +28 -6
- package/src/phaser/display/webgl/texture.js +28 -15
- package/src/phaser/display/webgl/texture_util.js +0 -6
- package/src/phaser/display/webgl/util.js +0 -7
- package/src/phaser/geom/circle.js +123 -18
- package/src/phaser/geom/ellipse.js +39 -18
- package/src/phaser/geom/line.js +148 -16
- package/src/phaser/geom/matrix.js +73 -6
- package/src/phaser/geom/point.js +152 -6
- package/src/phaser/geom/polygon.js +42 -14
- package/src/phaser/geom/rectangle.js +233 -6
- package/src/phaser/geom/rounded_rectangle.js +10 -6
- package/src/phaser/geom/util/circle.js +3 -9
- package/src/phaser/geom/util/ellipse.js +0 -7
- package/src/phaser/geom/util/line.js +5 -14
- package/src/phaser/geom/util/matrix.js +1 -7
- package/src/phaser/geom/util/point.js +0 -6
- package/src/phaser/geom/util/polygon.js +1 -7
- package/src/phaser/geom/util/rectangle.js +1 -7
- package/src/phaser/geom/util/rounded_rectangle.js +1 -7
- package/src/phaser/util/math.js +3 -21
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/phaser/core/animation.d.ts +105 -4
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +87 -0
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/animation_parser.d.ts +5 -4
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/array_set.d.ts +53 -7
- package/types/phaser/core/array_set.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +346 -56
- package/types/phaser/core/cache.d.ts.map +1 -1
- package/types/phaser/core/const.d.ts +143 -40
- package/types/phaser/core/const.d.ts.map +1 -1
- package/types/phaser/core/device.d.ts +0 -5
- package/types/phaser/core/device.d.ts.map +1 -1
- package/types/phaser/core/device_util.d.ts +1 -1
- package/types/phaser/core/device_util.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +119 -0
- package/types/phaser/core/dom.d.ts.map +1 -1
- package/types/phaser/core/event_manager.d.ts +127 -0
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +74 -7
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/frame.d.ts +64 -21
- package/types/phaser/core/frame.d.ts.map +1 -1
- package/types/phaser/core/frame_data.d.ts +61 -9
- package/types/phaser/core/frame_data.d.ts.map +1 -1
- package/types/phaser/core/frame_util.d.ts +10 -8
- package/types/phaser/core/frame_util.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +40 -6
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +114 -3
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_handler.d.ts +257 -24
- package/types/phaser/core/input_handler.d.ts.map +1 -1
- package/types/phaser/core/input_mouse.d.ts +51 -4
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +43 -9
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +78 -2
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +45 -8
- package/types/phaser/core/input_touch.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +264 -19
- package/types/phaser/core/loader.d.ts.map +1 -1
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +17 -7
- package/types/phaser/core/raf.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +201 -6
- package/types/phaser/core/scale_manager.d.ts.map +1 -1
- package/types/phaser/core/scene.d.ts +21 -5
- package/types/phaser/core/scene.d.ts.map +1 -1
- package/types/phaser/core/scene_manager.d.ts +90 -10
- package/types/phaser/core/scene_manager.d.ts.map +1 -1
- package/types/phaser/core/signal.d.ts +93 -9
- package/types/phaser/core/signal.d.ts.map +1 -1
- package/types/phaser/core/signal_binding.d.ts +34 -5
- package/types/phaser/core/signal_binding.d.ts.map +1 -1
- package/types/phaser/core/sound.d.ts +111 -14
- package/types/phaser/core/sound.d.ts.map +1 -1
- package/types/phaser/core/sound_manager.d.ts +93 -7
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +22 -8
- package/types/phaser/core/sound_sprite.d.ts.map +1 -1
- package/types/phaser/core/stage.d.ts +32 -3
- package/types/phaser/core/stage.d.ts.map +1 -1
- package/types/phaser/core/time.d.ts +73 -6
- package/types/phaser/core/time.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +103 -2
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +11 -5
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +122 -2
- package/types/phaser/core/tween.d.ts.map +1 -1
- package/types/phaser/core/tween_data.d.ts +41 -2
- package/types/phaser/core/tween_data.d.ts.map +1 -1
- package/types/phaser/core/tween_easing.d.ts +0 -5
- package/types/phaser/core/tween_easing.d.ts.map +1 -1
- package/types/phaser/core/tween_manager.d.ts +49 -2
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/core/world.d.ts +9 -1
- package/types/phaser/core/world.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +84 -7
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +65 -8
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +20 -4
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/types/phaser/display/canvas/masker.d.ts.map +1 -1
- package/types/phaser/display/canvas/pool.d.ts +0 -6
- package/types/phaser/display/canvas/pool.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +29 -2
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/types/phaser/display/canvas/util.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +195 -8
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +132 -6
- package/types/phaser/display/graphics.d.ts.map +1 -1
- package/types/phaser/display/graphics_data.d.ts +15 -1
- package/types/phaser/display/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/graphics_data_util.d.ts +3 -2
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/types/phaser/display/group.d.ts +62 -0
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +66 -2
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/sprite_batch.d.ts +4 -3
- package/types/phaser/display/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +366 -46
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts +8 -6
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/types/phaser/display/webgl/base_texture.d.ts +20 -1
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/blend_manager.d.ts +11 -6
- package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut_node.d.ts +9 -9
- package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +33 -6
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_manager.d.ts +22 -6
- package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_texture.d.ts +21 -3
- package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +10 -6
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +30 -3
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +41 -4
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +10 -0
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +10 -0
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +20 -0
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +10 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +10 -0
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +15 -0
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts +37 -0
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts +25 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture.d.ts +21 -0
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/types/phaser/display/webgl/util.d.ts +0 -6
- package/types/phaser/display/webgl/util.d.ts.map +1 -1
- package/types/phaser/geom/circle.d.ts +131 -9
- package/types/phaser/geom/circle.d.ts.map +1 -1
- package/types/phaser/geom/ellipse.d.ts +43 -5
- package/types/phaser/geom/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/line.d.ts +159 -13
- package/types/phaser/geom/line.d.ts.map +1 -1
- package/types/phaser/geom/matrix.d.ts +85 -11
- package/types/phaser/geom/matrix.d.ts.map +1 -1
- package/types/phaser/geom/point.d.ts +170 -18
- package/types/phaser/geom/point.d.ts.map +1 -1
- package/types/phaser/geom/polygon.d.ts +45 -5
- package/types/phaser/geom/polygon.d.ts.map +1 -1
- package/types/phaser/geom/rectangle.d.ts +253 -20
- package/types/phaser/geom/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/rounded_rectangle.d.ts +11 -1
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/circle.d.ts +3 -3
- package/types/phaser/geom/util/circle.d.ts.map +1 -1
- package/types/phaser/geom/util/ellipse.d.ts +0 -6
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/util/line.d.ts +5 -5
- package/types/phaser/geom/util/line.d.ts.map +1 -1
- package/types/phaser/geom/util/matrix.d.ts.map +1 -1
- package/types/phaser/geom/util/point.d.ts.map +1 -1
- package/types/phaser/geom/util/polygon.d.ts.map +1 -1
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/util/math.d.ts +0 -5
- package/types/phaser/util/math.d.ts.map +1 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module display/text
|
|
3
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
4
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
5
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
6
|
-
*/
|
|
7
1
|
import { Point } from '../geom/point';
|
|
8
|
-
import { Rectangle } from
|
|
2
|
+
import { Rectangle } from '../geom/rectangle';
|
|
9
3
|
import { Image } from './image';
|
|
10
4
|
import { create, remove } from './canvas/pool';
|
|
11
5
|
import { textureFromCanvas } from './webgl/texture_util';
|
|
12
|
-
import { Game } from
|
|
6
|
+
import { Game } from '../core/game';
|
|
13
7
|
import { TEXT } from '../core/const';
|
|
14
8
|
import { snapToCeil } from '../util/math';
|
|
15
9
|
import { renderCanvas, renderWebGL, getBounds } from './sprite_util';
|
|
@@ -52,6 +46,9 @@ export class Text extends Image {
|
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
48
|
|
|
49
|
+
/**
|
|
50
|
+
* TBD.
|
|
51
|
+
*/
|
|
55
52
|
destroy() {
|
|
56
53
|
this.texture.destroy(true);
|
|
57
54
|
remove(this);
|
|
@@ -69,14 +66,16 @@ export class Text extends Image {
|
|
|
69
66
|
super.destroy();
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
/**
|
|
70
|
+
* TBD.
|
|
71
|
+
* @param {number} x - TBD.
|
|
72
|
+
* @param {number} y - TBD.
|
|
73
|
+
* @param color - TBD.
|
|
74
|
+
* @param blur
|
|
75
|
+
* @param shadowStroke
|
|
76
|
+
* @param shadowFill
|
|
77
|
+
*/
|
|
78
|
+
setShadow(x = 0, y = 0, color = 'rgba(0, 0, 0, 1)', blur = 0, shadowStroke = true, shadowFill = true) {
|
|
80
79
|
this.style.shadowOffsetX = x;
|
|
81
80
|
this.style.shadowOffsetY = y;
|
|
82
81
|
this.style.shadowColor = color;
|
|
@@ -87,6 +86,11 @@ export class Text extends Image {
|
|
|
87
86
|
return this;
|
|
88
87
|
}
|
|
89
88
|
|
|
89
|
+
/**
|
|
90
|
+
* TBD.
|
|
91
|
+
* @param style
|
|
92
|
+
* @param update
|
|
93
|
+
*/
|
|
90
94
|
setStyle(style = null, update = false) {
|
|
91
95
|
style = JSON.parse(JSON.stringify(style)) || {};
|
|
92
96
|
style.font = style.font || 'bold 20pt Arial';
|
|
@@ -131,6 +135,9 @@ export class Text extends Image {
|
|
|
131
135
|
return this;
|
|
132
136
|
}
|
|
133
137
|
|
|
138
|
+
/**
|
|
139
|
+
* TBD.
|
|
140
|
+
*/
|
|
134
141
|
updateText() {
|
|
135
142
|
this.texture.baseTexture.resolution = this._res;
|
|
136
143
|
this.context.font = this.style.font;
|
|
@@ -288,6 +295,13 @@ export class Text extends Image {
|
|
|
288
295
|
this.dirty = false;
|
|
289
296
|
}
|
|
290
297
|
|
|
298
|
+
/**
|
|
299
|
+
* TBD.
|
|
300
|
+
* @param line
|
|
301
|
+
* @param {number} x - TBD.
|
|
302
|
+
* @param {number} y - TBD.
|
|
303
|
+
* @param fill
|
|
304
|
+
*/
|
|
291
305
|
renderTabLine(line, x, y, fill) {
|
|
292
306
|
const text = line.split(/(?:\t)/);
|
|
293
307
|
const tabs = this.style.tabs;
|
|
@@ -320,6 +334,10 @@ export class Text extends Image {
|
|
|
320
334
|
}
|
|
321
335
|
}
|
|
322
336
|
|
|
337
|
+
/**
|
|
338
|
+
* TBD.
|
|
339
|
+
* @param state
|
|
340
|
+
*/
|
|
323
341
|
updateShadow(state) {
|
|
324
342
|
if (state) {
|
|
325
343
|
this.context.shadowOffsetX = this.style.shadowOffsetX;
|
|
@@ -334,6 +352,10 @@ export class Text extends Image {
|
|
|
334
352
|
}
|
|
335
353
|
}
|
|
336
354
|
|
|
355
|
+
/**
|
|
356
|
+
* TBD.
|
|
357
|
+
* @param line
|
|
358
|
+
*/
|
|
337
359
|
measureLine(line) {
|
|
338
360
|
let lineLength = 0;
|
|
339
361
|
for (let i = 0; i < line.length; i += 1) {
|
|
@@ -366,6 +388,12 @@ export class Text extends Image {
|
|
|
366
388
|
return Math.ceil(lineLength);
|
|
367
389
|
}
|
|
368
390
|
|
|
391
|
+
/**
|
|
392
|
+
* TBD.
|
|
393
|
+
* @param line
|
|
394
|
+
* @param {number} x - TBD.
|
|
395
|
+
* @param {number} y - TBD.
|
|
396
|
+
*/
|
|
369
397
|
updateLine(line, x, y) {
|
|
370
398
|
for (let i = 0; i < line.length; i += 1) {
|
|
371
399
|
const letter = line[i];
|
|
@@ -398,6 +426,9 @@ export class Text extends Image {
|
|
|
398
426
|
}
|
|
399
427
|
}
|
|
400
428
|
|
|
429
|
+
/**
|
|
430
|
+
* TBD.
|
|
431
|
+
*/
|
|
401
432
|
clearColors() {
|
|
402
433
|
this.colors = [];
|
|
403
434
|
this.strokeColors = [];
|
|
@@ -405,6 +436,9 @@ export class Text extends Image {
|
|
|
405
436
|
return this;
|
|
406
437
|
}
|
|
407
438
|
|
|
439
|
+
/**
|
|
440
|
+
* TBD.
|
|
441
|
+
*/
|
|
408
442
|
clearFontValues() {
|
|
409
443
|
this.fontStyles = [];
|
|
410
444
|
this.fontWeights = [];
|
|
@@ -412,30 +446,54 @@ export class Text extends Image {
|
|
|
412
446
|
return this;
|
|
413
447
|
}
|
|
414
448
|
|
|
449
|
+
/**
|
|
450
|
+
* TBD.
|
|
451
|
+
* @param color - TBD.
|
|
452
|
+
* @param position - TBD.
|
|
453
|
+
*/
|
|
415
454
|
addColor(color, position) {
|
|
416
455
|
this.colors[position] = color;
|
|
417
456
|
this.dirty = true;
|
|
418
457
|
return this;
|
|
419
458
|
}
|
|
420
459
|
|
|
460
|
+
/**
|
|
461
|
+
* TBD.
|
|
462
|
+
* @param color - TBD.
|
|
463
|
+
* @param position - TBD.
|
|
464
|
+
*/
|
|
421
465
|
addStrokeColor(color, position) {
|
|
422
466
|
this.strokeColors[position] = color;
|
|
423
467
|
this.dirty = true;
|
|
424
468
|
return this;
|
|
425
469
|
}
|
|
426
470
|
|
|
471
|
+
/**
|
|
472
|
+
* TBD.
|
|
473
|
+
* @param style
|
|
474
|
+
* @param position - TBD.
|
|
475
|
+
*/
|
|
427
476
|
addFontStyle(style, position) {
|
|
428
477
|
this.fontStyles[position] = style;
|
|
429
478
|
this.dirty = true;
|
|
430
479
|
return this;
|
|
431
480
|
}
|
|
432
481
|
|
|
482
|
+
/**
|
|
483
|
+
* TBD.
|
|
484
|
+
* @param weight
|
|
485
|
+
* @param position - TBD.
|
|
486
|
+
*/
|
|
433
487
|
addFontWeight(weight, position) {
|
|
434
488
|
this.fontWeights[position] = weight;
|
|
435
489
|
this.dirty = true;
|
|
436
490
|
return this;
|
|
437
491
|
}
|
|
438
492
|
|
|
493
|
+
/**
|
|
494
|
+
* TBD.
|
|
495
|
+
* @param text - TBD.
|
|
496
|
+
*/
|
|
439
497
|
precalculateWordWrap(text) {
|
|
440
498
|
this.texture.baseTexture.resolution = this._res;
|
|
441
499
|
this.context.font = this.style.font;
|
|
@@ -443,6 +501,10 @@ export class Text extends Image {
|
|
|
443
501
|
return wrappedLines.split(/(?:\r\n|\r|\n)/);
|
|
444
502
|
}
|
|
445
503
|
|
|
504
|
+
/**
|
|
505
|
+
* TBD.
|
|
506
|
+
* @param text - TBD.
|
|
507
|
+
*/
|
|
446
508
|
runWordWrap(text) {
|
|
447
509
|
if (this.useAdvancedWrap) {
|
|
448
510
|
return this.advancedWordWrap(text);
|
|
@@ -450,6 +512,10 @@ export class Text extends Image {
|
|
|
450
512
|
return this.basicWordWrap(text);
|
|
451
513
|
}
|
|
452
514
|
|
|
515
|
+
/**
|
|
516
|
+
* TBD.
|
|
517
|
+
* @param text - TBD.
|
|
518
|
+
*/
|
|
453
519
|
advancedWordWrap(text) {
|
|
454
520
|
const context = this.context;
|
|
455
521
|
const wordWrapWidth = this.style.wordWrapWidth;
|
|
@@ -492,9 +558,7 @@ export class Text extends Image {
|
|
|
492
558
|
// if wordWrapWidth is too small for even a single
|
|
493
559
|
// letter, shame user failure with a fatal error
|
|
494
560
|
if (!newWord.length) {
|
|
495
|
-
throw new Error(
|
|
496
|
-
"This text's wordWrapWidth setting is less than a single character!"
|
|
497
|
-
);
|
|
561
|
+
throw new Error("This text's wordWrapWidth setting is less than a single character!");
|
|
498
562
|
}
|
|
499
563
|
// replace current word in array with remainder
|
|
500
564
|
const secondPart = word.substr(newWord.length);
|
|
@@ -529,6 +593,10 @@ export class Text extends Image {
|
|
|
529
593
|
return output;
|
|
530
594
|
}
|
|
531
595
|
|
|
596
|
+
/**
|
|
597
|
+
* TBD.
|
|
598
|
+
* @param text - TBD.
|
|
599
|
+
*/
|
|
532
600
|
basicWordWrap(text) {
|
|
533
601
|
let result = '';
|
|
534
602
|
const lines = text.split('\n');
|
|
@@ -557,6 +625,10 @@ export class Text extends Image {
|
|
|
557
625
|
return result;
|
|
558
626
|
}
|
|
559
627
|
|
|
628
|
+
/**
|
|
629
|
+
* TBD.
|
|
630
|
+
* @param components
|
|
631
|
+
*/
|
|
560
632
|
updateFont(components) {
|
|
561
633
|
const font = this.componentsToFont(components);
|
|
562
634
|
if (this.style.font !== font) {
|
|
@@ -568,6 +640,10 @@ export class Text extends Image {
|
|
|
568
640
|
}
|
|
569
641
|
}
|
|
570
642
|
|
|
643
|
+
/**
|
|
644
|
+
* TBD.
|
|
645
|
+
* @param font - TBD.
|
|
646
|
+
*/
|
|
571
647
|
fontToComponents(font) {
|
|
572
648
|
// The format is specified in http://www.w3.org/TR/CSS2/fonts.html#font-shorthand:
|
|
573
649
|
// style - normal | italic | oblique | inherit
|
|
@@ -583,10 +659,7 @@ export class Text extends Image {
|
|
|
583
659
|
if (m) {
|
|
584
660
|
let family = m[5].trim();
|
|
585
661
|
// If it looks like the value should be quoted, but isn't, then quote it.
|
|
586
|
-
if (
|
|
587
|
-
!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(family) &&
|
|
588
|
-
!/['",]/.exec(family)
|
|
589
|
-
) {
|
|
662
|
+
if (!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(family) && !/['",]/.exec(family)) {
|
|
590
663
|
family = "'" + family + "'";
|
|
591
664
|
}
|
|
592
665
|
return {
|
|
@@ -602,6 +675,10 @@ export class Text extends Image {
|
|
|
602
675
|
return { font };
|
|
603
676
|
}
|
|
604
677
|
|
|
678
|
+
/**
|
|
679
|
+
* TBD.
|
|
680
|
+
* @param components
|
|
681
|
+
*/
|
|
605
682
|
componentsToFont(components) {
|
|
606
683
|
const parts = [];
|
|
607
684
|
let v;
|
|
@@ -632,6 +709,11 @@ export class Text extends Image {
|
|
|
632
709
|
return parts.join(' ');
|
|
633
710
|
}
|
|
634
711
|
|
|
712
|
+
/**
|
|
713
|
+
* TBD.
|
|
714
|
+
* @param text - TBD.
|
|
715
|
+
* @param immediate
|
|
716
|
+
*/
|
|
635
717
|
setText(text, immediate = false) {
|
|
636
718
|
this.text = text.toString() || '';
|
|
637
719
|
if (immediate) {
|
|
@@ -642,6 +724,10 @@ export class Text extends Image {
|
|
|
642
724
|
return this;
|
|
643
725
|
}
|
|
644
726
|
|
|
727
|
+
/**
|
|
728
|
+
* TBD.
|
|
729
|
+
* @param list
|
|
730
|
+
*/
|
|
645
731
|
parseList(list) {
|
|
646
732
|
if (!Array.isArray(list)) {
|
|
647
733
|
return this;
|
|
@@ -665,6 +751,13 @@ export class Text extends Image {
|
|
|
665
751
|
return this;
|
|
666
752
|
}
|
|
667
753
|
|
|
754
|
+
/**
|
|
755
|
+
* TBD.
|
|
756
|
+
* @param {number} x - TBD.
|
|
757
|
+
* @param {number} y - TBD.
|
|
758
|
+
* @param {number} width - TBD.
|
|
759
|
+
* @param {number} height - TBD.
|
|
760
|
+
*/
|
|
668
761
|
setTextBounds(x, y, width, height) {
|
|
669
762
|
if (x === undefined) {
|
|
670
763
|
this.textBounds = null;
|
|
@@ -682,6 +775,9 @@ export class Text extends Image {
|
|
|
682
775
|
return this;
|
|
683
776
|
}
|
|
684
777
|
|
|
778
|
+
/**
|
|
779
|
+
* TBD.
|
|
780
|
+
*/
|
|
685
781
|
updateTexture() {
|
|
686
782
|
const base = this.texture.baseTexture;
|
|
687
783
|
const crop = this.texture.crop;
|
|
@@ -721,6 +817,10 @@ export class Text extends Image {
|
|
|
721
817
|
this.texture.baseTexture.dirty();
|
|
722
818
|
}
|
|
723
819
|
|
|
820
|
+
/**
|
|
821
|
+
* TBD.
|
|
822
|
+
* @param renderSession - TBD.
|
|
823
|
+
*/
|
|
724
824
|
renderWebGL(renderSession) {
|
|
725
825
|
if (this.dirty) {
|
|
726
826
|
this.updateText();
|
|
@@ -729,6 +829,10 @@ export class Text extends Image {
|
|
|
729
829
|
renderWebGL(this, renderSession);
|
|
730
830
|
}
|
|
731
831
|
|
|
832
|
+
/**
|
|
833
|
+
* TBD.
|
|
834
|
+
* @param renderSession - TBD.
|
|
835
|
+
*/
|
|
732
836
|
renderCanvas(renderSession) {
|
|
733
837
|
if (this.dirty) {
|
|
734
838
|
this.updateText();
|
|
@@ -737,6 +841,9 @@ export class Text extends Image {
|
|
|
737
841
|
renderCanvas(this, renderSession);
|
|
738
842
|
}
|
|
739
843
|
|
|
844
|
+
/**
|
|
845
|
+
* TBD.
|
|
846
|
+
*/
|
|
740
847
|
getFontPropertiesCache() {
|
|
741
848
|
if (!window.PhaserRegistry.fontPropertiesCache) {
|
|
742
849
|
window.PhaserRegistry.fontPropertiesCache = {};
|
|
@@ -744,6 +851,9 @@ export class Text extends Image {
|
|
|
744
851
|
return window.PhaserRegistry.fontPropertiesCache;
|
|
745
852
|
}
|
|
746
853
|
|
|
854
|
+
/**
|
|
855
|
+
* TBD.
|
|
856
|
+
*/
|
|
747
857
|
getFontPropertiesCanvas() {
|
|
748
858
|
if (!window.PhaserRegistry.fontPropertiesCanvas) {
|
|
749
859
|
window.PhaserRegistry.fontPropertiesCanvas = document.createElement('canvas');
|
|
@@ -751,16 +861,22 @@ export class Text extends Image {
|
|
|
751
861
|
return window.PhaserRegistry.fontPropertiesCanvas;
|
|
752
862
|
}
|
|
753
863
|
|
|
864
|
+
/**
|
|
865
|
+
* TBD.
|
|
866
|
+
*/
|
|
754
867
|
getFontPropertiesContext() {
|
|
755
868
|
if (!window.PhaserRegistry.fontPropertiesContext) {
|
|
756
|
-
window.PhaserRegistry.fontPropertiesContext = this.getFontPropertiesCanvas().getContext(
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
);
|
|
869
|
+
window.PhaserRegistry.fontPropertiesContext = this.getFontPropertiesCanvas().getContext('2d', {
|
|
870
|
+
willReadFrequently: true,
|
|
871
|
+
});
|
|
760
872
|
}
|
|
761
873
|
return window.PhaserRegistry.fontPropertiesContext;
|
|
762
874
|
}
|
|
763
875
|
|
|
876
|
+
/**
|
|
877
|
+
* TBD.
|
|
878
|
+
* @param fontStyle
|
|
879
|
+
*/
|
|
764
880
|
determineFontProperties(fontStyle) {
|
|
765
881
|
const fontPropertiesCache = this.getFontPropertiesCache();
|
|
766
882
|
let properties = fontPropertiesCache[fontStyle];
|
|
@@ -835,6 +951,11 @@ export class Text extends Image {
|
|
|
835
951
|
return properties;
|
|
836
952
|
}
|
|
837
953
|
|
|
954
|
+
/**
|
|
955
|
+
* TBD.
|
|
956
|
+
* @param matrix - TBD.
|
|
957
|
+
* @returns {Rectangle} TBD.
|
|
958
|
+
*/
|
|
838
959
|
getBounds(matrix = null) {
|
|
839
960
|
if (this.dirty) {
|
|
840
961
|
this.updateText();
|
|
@@ -843,10 +964,17 @@ export class Text extends Image {
|
|
|
843
964
|
return getBounds(this, matrix);
|
|
844
965
|
}
|
|
845
966
|
|
|
967
|
+
/**
|
|
968
|
+
* TBD.
|
|
969
|
+
* @returns {string} TBD.
|
|
970
|
+
*/
|
|
846
971
|
get text() {
|
|
847
972
|
return this._text;
|
|
848
973
|
}
|
|
849
974
|
|
|
975
|
+
/**
|
|
976
|
+
* TBD.
|
|
977
|
+
*/
|
|
850
978
|
set text(value) {
|
|
851
979
|
if (value !== this._text) {
|
|
852
980
|
this._text = value.toString() || '';
|
|
@@ -857,27 +985,38 @@ export class Text extends Image {
|
|
|
857
985
|
}
|
|
858
986
|
}
|
|
859
987
|
|
|
988
|
+
/**
|
|
989
|
+
* TBD.
|
|
990
|
+
* @returns {string} TBD.
|
|
991
|
+
*/
|
|
860
992
|
get cssFont() {
|
|
861
993
|
return this.componentsToFont(this._fontComponents);
|
|
862
994
|
}
|
|
863
995
|
|
|
996
|
+
/**
|
|
997
|
+
* TBD.
|
|
998
|
+
*/
|
|
864
999
|
set cssFont(value) {
|
|
865
1000
|
this._fontComponents = this.fontToComponents(value || 'bold 20pt Arial');
|
|
866
1001
|
this.updateFont(this._fontComponents);
|
|
867
1002
|
}
|
|
868
1003
|
|
|
1004
|
+
/**
|
|
1005
|
+
* TBD.
|
|
1006
|
+
* @returns {number} TBD.
|
|
1007
|
+
*/
|
|
869
1008
|
get font() {
|
|
870
1009
|
return this._fontComponents.fontFamily;
|
|
871
1010
|
}
|
|
872
1011
|
|
|
1012
|
+
/**
|
|
1013
|
+
* TBD.
|
|
1014
|
+
*/
|
|
873
1015
|
set font(value) {
|
|
874
1016
|
let mutatedValue = value || 'Arial';
|
|
875
1017
|
mutatedValue = mutatedValue.trim();
|
|
876
1018
|
// If it looks like the value should be quoted, but isn't, then quote it.
|
|
877
|
-
if (
|
|
878
|
-
!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(mutatedValue) &&
|
|
879
|
-
!/['",]/.exec(mutatedValue)
|
|
880
|
-
) {
|
|
1019
|
+
if (!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(mutatedValue) && !/['",]/.exec(mutatedValue)) {
|
|
881
1020
|
mutatedValue = "'" + mutatedValue + "'";
|
|
882
1021
|
}
|
|
883
1022
|
|
|
@@ -885,6 +1024,10 @@ export class Text extends Image {
|
|
|
885
1024
|
this.updateFont(this._fontComponents);
|
|
886
1025
|
}
|
|
887
1026
|
|
|
1027
|
+
/**
|
|
1028
|
+
* TBD.
|
|
1029
|
+
* @returns {number} TBD.
|
|
1030
|
+
*/
|
|
888
1031
|
get fontSize() {
|
|
889
1032
|
const size = this._fontComponents.fontSize;
|
|
890
1033
|
if (size && /(?:^0$|px$)/.exec(size)) {
|
|
@@ -893,6 +1036,9 @@ export class Text extends Image {
|
|
|
893
1036
|
return size;
|
|
894
1037
|
}
|
|
895
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* TBD.
|
|
1041
|
+
*/
|
|
896
1042
|
set fontSize(value) {
|
|
897
1043
|
let mutatedValue = value || '0';
|
|
898
1044
|
if (typeof mutatedValue === 'number') {
|
|
@@ -902,37 +1048,65 @@ export class Text extends Image {
|
|
|
902
1048
|
this.updateFont(this._fontComponents);
|
|
903
1049
|
}
|
|
904
1050
|
|
|
1051
|
+
/**
|
|
1052
|
+
* TBD.
|
|
1053
|
+
* @returns {string} TBD.
|
|
1054
|
+
*/
|
|
905
1055
|
get fontWeight() {
|
|
906
1056
|
return this._fontComponents.fontWeight || 'normal';
|
|
907
1057
|
}
|
|
908
1058
|
|
|
1059
|
+
/**
|
|
1060
|
+
* TBD.
|
|
1061
|
+
*/
|
|
909
1062
|
set fontWeight(value) {
|
|
910
1063
|
this._fontComponents.fontWeight = value || 'normal';
|
|
911
1064
|
this.updateFont(this._fontComponents);
|
|
912
1065
|
}
|
|
913
1066
|
|
|
1067
|
+
/**
|
|
1068
|
+
* TBD.
|
|
1069
|
+
* @returns {string} TBD.
|
|
1070
|
+
*/
|
|
914
1071
|
get fontStyle() {
|
|
915
1072
|
return this._fontComponents.fontStyle || 'normal';
|
|
916
1073
|
}
|
|
917
1074
|
|
|
1075
|
+
/**
|
|
1076
|
+
* TBD.
|
|
1077
|
+
*/
|
|
918
1078
|
set fontStyle(value) {
|
|
919
1079
|
this._fontComponents.fontStyle = value || 'normal';
|
|
920
1080
|
this.updateFont(this._fontComponents);
|
|
921
1081
|
}
|
|
922
1082
|
|
|
1083
|
+
/**
|
|
1084
|
+
* TBD.
|
|
1085
|
+
* @returns {string} TBD.
|
|
1086
|
+
*/
|
|
923
1087
|
get fontVariant() {
|
|
924
1088
|
return this._fontComponents.fontVariant || 'normal';
|
|
925
1089
|
}
|
|
926
1090
|
|
|
1091
|
+
/**
|
|
1092
|
+
* TBD.
|
|
1093
|
+
*/
|
|
927
1094
|
set fontVariant(value) {
|
|
928
1095
|
this._fontComponents.fontVariant = value || 'normal';
|
|
929
1096
|
this.updateFont(this._fontComponents);
|
|
930
1097
|
}
|
|
931
1098
|
|
|
1099
|
+
/**
|
|
1100
|
+
* TBD.
|
|
1101
|
+
* @returns {number} TBD.
|
|
1102
|
+
*/
|
|
932
1103
|
get fill() {
|
|
933
1104
|
return this.style.fill;
|
|
934
1105
|
}
|
|
935
1106
|
|
|
1107
|
+
/**
|
|
1108
|
+
* TBD.
|
|
1109
|
+
*/
|
|
936
1110
|
set fill(value) {
|
|
937
1111
|
if (value !== this.style.fill) {
|
|
938
1112
|
this.style.fill = value;
|
|
@@ -940,10 +1114,17 @@ export class Text extends Image {
|
|
|
940
1114
|
}
|
|
941
1115
|
}
|
|
942
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* TBD.
|
|
1119
|
+
* @returns {string} TBD.
|
|
1120
|
+
*/
|
|
943
1121
|
get align() {
|
|
944
1122
|
return this.style.align;
|
|
945
1123
|
}
|
|
946
1124
|
|
|
1125
|
+
/**
|
|
1126
|
+
* TBD.
|
|
1127
|
+
*/
|
|
947
1128
|
set align(value) {
|
|
948
1129
|
if (value !== this.style.align) {
|
|
949
1130
|
this.style.align = value;
|
|
@@ -951,10 +1132,17 @@ export class Text extends Image {
|
|
|
951
1132
|
}
|
|
952
1133
|
}
|
|
953
1134
|
|
|
1135
|
+
/**
|
|
1136
|
+
* TBD.
|
|
1137
|
+
* @returns {number} TBD.
|
|
1138
|
+
*/
|
|
954
1139
|
get resolution() {
|
|
955
1140
|
return this._res;
|
|
956
1141
|
}
|
|
957
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* TBD.
|
|
1145
|
+
*/
|
|
958
1146
|
set resolution(value) {
|
|
959
1147
|
if (value !== this._res) {
|
|
960
1148
|
this._res = value;
|
|
@@ -962,10 +1150,17 @@ export class Text extends Image {
|
|
|
962
1150
|
}
|
|
963
1151
|
}
|
|
964
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* TBD.
|
|
1155
|
+
* @returns {number} TBD.
|
|
1156
|
+
*/
|
|
965
1157
|
get tabs() {
|
|
966
1158
|
return this.style.tabs;
|
|
967
1159
|
}
|
|
968
1160
|
|
|
1161
|
+
/**
|
|
1162
|
+
* TBD.
|
|
1163
|
+
*/
|
|
969
1164
|
set tabs(value) {
|
|
970
1165
|
if (value !== this.style.tabs) {
|
|
971
1166
|
this.style.tabs = value;
|
|
@@ -973,10 +1168,17 @@ export class Text extends Image {
|
|
|
973
1168
|
}
|
|
974
1169
|
}
|
|
975
1170
|
|
|
1171
|
+
/**
|
|
1172
|
+
* TBD.
|
|
1173
|
+
* @returns {number} TBD.
|
|
1174
|
+
*/
|
|
976
1175
|
get boundsAlignH() {
|
|
977
1176
|
return this.style.boundsAlignH;
|
|
978
1177
|
}
|
|
979
1178
|
|
|
1179
|
+
/**
|
|
1180
|
+
* TBD.
|
|
1181
|
+
*/
|
|
980
1182
|
set boundsAlignH(value) {
|
|
981
1183
|
if (value !== this.style.boundsAlignH) {
|
|
982
1184
|
this.style.boundsAlignH = value;
|
|
@@ -984,10 +1186,17 @@ export class Text extends Image {
|
|
|
984
1186
|
}
|
|
985
1187
|
}
|
|
986
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* TBD.
|
|
1191
|
+
* @returns {number} TBD.
|
|
1192
|
+
*/
|
|
987
1193
|
get boundsAlignV() {
|
|
988
1194
|
return this.style.boundsAlignV;
|
|
989
1195
|
}
|
|
990
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* TBD.
|
|
1199
|
+
*/
|
|
991
1200
|
set boundsAlignV(value) {
|
|
992
1201
|
if (value !== this.style.boundsAlignV) {
|
|
993
1202
|
this.style.boundsAlignV = value;
|
|
@@ -995,10 +1204,17 @@ export class Text extends Image {
|
|
|
995
1204
|
}
|
|
996
1205
|
}
|
|
997
1206
|
|
|
1207
|
+
/**
|
|
1208
|
+
* TBD.
|
|
1209
|
+
* @returns {number} TBD.
|
|
1210
|
+
*/
|
|
998
1211
|
get stroke() {
|
|
999
1212
|
return this.style.stroke;
|
|
1000
1213
|
}
|
|
1001
1214
|
|
|
1215
|
+
/**
|
|
1216
|
+
* TBD.
|
|
1217
|
+
*/
|
|
1002
1218
|
set stroke(value) {
|
|
1003
1219
|
if (value !== this.style.stroke) {
|
|
1004
1220
|
this.style.stroke = value;
|
|
@@ -1006,10 +1222,17 @@ export class Text extends Image {
|
|
|
1006
1222
|
}
|
|
1007
1223
|
}
|
|
1008
1224
|
|
|
1225
|
+
/**
|
|
1226
|
+
* TBD.
|
|
1227
|
+
* @returns {number} TBD.
|
|
1228
|
+
*/
|
|
1009
1229
|
get strokeThickness() {
|
|
1010
1230
|
return this.style.strokeThickness;
|
|
1011
1231
|
}
|
|
1012
1232
|
|
|
1233
|
+
/**
|
|
1234
|
+
* TBD.
|
|
1235
|
+
*/
|
|
1013
1236
|
set strokeThickness(value) {
|
|
1014
1237
|
if (value !== this.style.strokeThickness) {
|
|
1015
1238
|
this.style.strokeThickness = value;
|
|
@@ -1017,10 +1240,17 @@ export class Text extends Image {
|
|
|
1017
1240
|
}
|
|
1018
1241
|
}
|
|
1019
1242
|
|
|
1243
|
+
/**
|
|
1244
|
+
* TBD.
|
|
1245
|
+
* @returns {number} TBD.
|
|
1246
|
+
*/
|
|
1020
1247
|
get wordWrap() {
|
|
1021
1248
|
return this.style.wordWrap;
|
|
1022
1249
|
}
|
|
1023
1250
|
|
|
1251
|
+
/**
|
|
1252
|
+
* TBD.
|
|
1253
|
+
*/
|
|
1024
1254
|
set wordWrap(value) {
|
|
1025
1255
|
if (value !== this.style.wordWrap) {
|
|
1026
1256
|
this.style.wordWrap = value;
|
|
@@ -1028,10 +1258,17 @@ export class Text extends Image {
|
|
|
1028
1258
|
}
|
|
1029
1259
|
}
|
|
1030
1260
|
|
|
1261
|
+
/**
|
|
1262
|
+
* TBD.
|
|
1263
|
+
* @returns {number} TBD.
|
|
1264
|
+
*/
|
|
1031
1265
|
get wordWrapWidth() {
|
|
1032
1266
|
return this.style.wordWrapWidth;
|
|
1033
1267
|
}
|
|
1034
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* TBD.
|
|
1271
|
+
*/
|
|
1035
1272
|
set wordWrapWidth(value) {
|
|
1036
1273
|
if (value !== this.style.wordWrapWidth) {
|
|
1037
1274
|
this.style.wordWrapWidth = value;
|
|
@@ -1039,10 +1276,17 @@ export class Text extends Image {
|
|
|
1039
1276
|
}
|
|
1040
1277
|
}
|
|
1041
1278
|
|
|
1279
|
+
/**
|
|
1280
|
+
* TBD.
|
|
1281
|
+
* @returns {number} TBD.
|
|
1282
|
+
*/
|
|
1042
1283
|
get lineSpacing() {
|
|
1043
1284
|
return this._lineSpacing;
|
|
1044
1285
|
}
|
|
1045
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* TBD.
|
|
1289
|
+
*/
|
|
1046
1290
|
set lineSpacing(value) {
|
|
1047
1291
|
if (value !== this._lineSpacing) {
|
|
1048
1292
|
this._lineSpacing = parseFloat(value);
|
|
@@ -1053,10 +1297,17 @@ export class Text extends Image {
|
|
|
1053
1297
|
}
|
|
1054
1298
|
}
|
|
1055
1299
|
|
|
1300
|
+
/**
|
|
1301
|
+
* TBD.
|
|
1302
|
+
* @returns {number} TBD.
|
|
1303
|
+
*/
|
|
1056
1304
|
get shadowOffsetX() {
|
|
1057
1305
|
return this.style.shadowOffsetX;
|
|
1058
1306
|
}
|
|
1059
1307
|
|
|
1308
|
+
/**
|
|
1309
|
+
* TBD.
|
|
1310
|
+
*/
|
|
1060
1311
|
set shadowOffsetX(value) {
|
|
1061
1312
|
if (value !== this.style.shadowOffsetX) {
|
|
1062
1313
|
this.style.shadowOffsetX = value;
|
|
@@ -1064,10 +1315,17 @@ export class Text extends Image {
|
|
|
1064
1315
|
}
|
|
1065
1316
|
}
|
|
1066
1317
|
|
|
1318
|
+
/**
|
|
1319
|
+
* TBD.
|
|
1320
|
+
* @returns {number} TBD.
|
|
1321
|
+
*/
|
|
1067
1322
|
get shadowOffsetY() {
|
|
1068
1323
|
return this.style.shadowOffsetY;
|
|
1069
1324
|
}
|
|
1070
1325
|
|
|
1326
|
+
/**
|
|
1327
|
+
* TBD.
|
|
1328
|
+
*/
|
|
1071
1329
|
set shadowOffsetY(value) {
|
|
1072
1330
|
if (value !== this.style.shadowOffsetY) {
|
|
1073
1331
|
this.style.shadowOffsetY = value;
|
|
@@ -1075,10 +1333,17 @@ export class Text extends Image {
|
|
|
1075
1333
|
}
|
|
1076
1334
|
}
|
|
1077
1335
|
|
|
1336
|
+
/**
|
|
1337
|
+
* TBD.
|
|
1338
|
+
* @returns {number} TBD.
|
|
1339
|
+
*/
|
|
1078
1340
|
get shadowColor() {
|
|
1079
1341
|
return this.style.shadowColor;
|
|
1080
1342
|
}
|
|
1081
1343
|
|
|
1344
|
+
/**
|
|
1345
|
+
* TBD.
|
|
1346
|
+
*/
|
|
1082
1347
|
set shadowColor(value) {
|
|
1083
1348
|
if (value !== this.style.shadowColor) {
|
|
1084
1349
|
this.style.shadowColor = value;
|
|
@@ -1086,10 +1351,17 @@ export class Text extends Image {
|
|
|
1086
1351
|
}
|
|
1087
1352
|
}
|
|
1088
1353
|
|
|
1354
|
+
/**
|
|
1355
|
+
* TBD.
|
|
1356
|
+
* @returns {number} TBD.
|
|
1357
|
+
*/
|
|
1089
1358
|
get shadowBlur() {
|
|
1090
1359
|
return this.style.shadowBlur;
|
|
1091
1360
|
}
|
|
1092
1361
|
|
|
1362
|
+
/**
|
|
1363
|
+
* TBD.
|
|
1364
|
+
*/
|
|
1093
1365
|
set shadowBlur(value) {
|
|
1094
1366
|
if (value !== this.style.shadowBlur) {
|
|
1095
1367
|
this.style.shadowBlur = value;
|
|
@@ -1097,10 +1369,17 @@ export class Text extends Image {
|
|
|
1097
1369
|
}
|
|
1098
1370
|
}
|
|
1099
1371
|
|
|
1372
|
+
/**
|
|
1373
|
+
* TBD.
|
|
1374
|
+
* @returns {number} TBD.
|
|
1375
|
+
*/
|
|
1100
1376
|
get shadowStroke() {
|
|
1101
1377
|
return this.style.shadowStroke;
|
|
1102
1378
|
}
|
|
1103
1379
|
|
|
1380
|
+
/**
|
|
1381
|
+
* TBD.
|
|
1382
|
+
*/
|
|
1104
1383
|
set shadowStroke(value) {
|
|
1105
1384
|
if (value !== this.style.shadowStroke) {
|
|
1106
1385
|
this.style.shadowStroke = value;
|
|
@@ -1108,10 +1387,17 @@ export class Text extends Image {
|
|
|
1108
1387
|
}
|
|
1109
1388
|
}
|
|
1110
1389
|
|
|
1390
|
+
/**
|
|
1391
|
+
* TBD.
|
|
1392
|
+
* @returns {number} TBD.
|
|
1393
|
+
*/
|
|
1111
1394
|
get shadowFill() {
|
|
1112
1395
|
return this.style.shadowFill;
|
|
1113
1396
|
}
|
|
1114
1397
|
|
|
1398
|
+
/**
|
|
1399
|
+
* TBD.
|
|
1400
|
+
*/
|
|
1115
1401
|
set shadowFill(value) {
|
|
1116
1402
|
if (value !== this.style.shadowFill) {
|
|
1117
1403
|
this.style.shadowFill = value;
|
|
@@ -1119,6 +1405,10 @@ export class Text extends Image {
|
|
|
1119
1405
|
}
|
|
1120
1406
|
}
|
|
1121
1407
|
|
|
1408
|
+
/**
|
|
1409
|
+
* TBD.
|
|
1410
|
+
* @returns {number} TBD.
|
|
1411
|
+
*/
|
|
1122
1412
|
get width() {
|
|
1123
1413
|
if (this.dirty) {
|
|
1124
1414
|
this.updateText();
|
|
@@ -1127,11 +1417,18 @@ export class Text extends Image {
|
|
|
1127
1417
|
return this.scale.x * this.texture.frame.width;
|
|
1128
1418
|
}
|
|
1129
1419
|
|
|
1420
|
+
/**
|
|
1421
|
+
* TBD.
|
|
1422
|
+
*/
|
|
1130
1423
|
set width(value) {
|
|
1131
1424
|
this.scale.x = value / this.texture.frame.width;
|
|
1132
1425
|
this._width = value;
|
|
1133
1426
|
}
|
|
1134
1427
|
|
|
1428
|
+
/**
|
|
1429
|
+
* TBD.
|
|
1430
|
+
* @returns {number} TBD.
|
|
1431
|
+
*/
|
|
1135
1432
|
get height() {
|
|
1136
1433
|
if (this.dirty) {
|
|
1137
1434
|
this.updateText();
|
|
@@ -1140,6 +1437,9 @@ export class Text extends Image {
|
|
|
1140
1437
|
return this.scale.y * this.texture.frame.height;
|
|
1141
1438
|
}
|
|
1142
1439
|
|
|
1440
|
+
/**
|
|
1441
|
+
* TBD.
|
|
1442
|
+
*/
|
|
1143
1443
|
set height(value) {
|
|
1144
1444
|
this.scale.y = value / this.texture.frame.height;
|
|
1145
1445
|
this._height = value;
|