@blakron/core 0.5.18 → 0.6.3

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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +29 -30
  3. package/dist/blakron/benchmark/SceneRegistry.js +13 -13
  4. package/dist/blakron/benchmark/SceneRegistry.js.map +1 -1
  5. package/dist/blakron/display/Bitmap.d.ts +4 -4
  6. package/dist/blakron/display/Bitmap.d.ts.map +1 -1
  7. package/dist/blakron/display/Bitmap.js +23 -23
  8. package/dist/blakron/display/Bitmap.js.map +1 -1
  9. package/dist/blakron/display/DisplayObject.d.ts +82 -86
  10. package/dist/blakron/display/DisplayObject.d.ts.map +1 -1
  11. package/dist/blakron/display/DisplayObject.js +293 -331
  12. package/dist/blakron/display/DisplayObject.js.map +1 -1
  13. package/dist/blakron/display/DisplayObjectContainer.d.ts +9 -8
  14. package/dist/blakron/display/DisplayObjectContainer.d.ts.map +1 -1
  15. package/dist/blakron/display/DisplayObjectContainer.js +86 -101
  16. package/dist/blakron/display/DisplayObjectContainer.js.map +1 -1
  17. package/dist/blakron/display/Graphics.d.ts +3 -3
  18. package/dist/blakron/display/Graphics.d.ts.map +1 -1
  19. package/dist/blakron/display/Graphics.js +6 -6
  20. package/dist/blakron/display/Graphics.js.map +1 -1
  21. package/dist/blakron/display/Mesh.d.ts +1 -1
  22. package/dist/blakron/display/Mesh.d.ts.map +1 -1
  23. package/dist/blakron/display/Mesh.js +4 -4
  24. package/dist/blakron/display/Mesh.js.map +1 -1
  25. package/dist/blakron/display/Shape.d.ts +3 -3
  26. package/dist/blakron/display/Shape.d.ts.map +1 -1
  27. package/dist/blakron/display/Shape.js +10 -10
  28. package/dist/blakron/display/Shape.js.map +1 -1
  29. package/dist/blakron/display/Sprite.d.ts +3 -3
  30. package/dist/blakron/display/Sprite.d.ts.map +1 -1
  31. package/dist/blakron/display/Sprite.js +10 -10
  32. package/dist/blakron/display/Sprite.js.map +1 -1
  33. package/dist/blakron/display/Stage.js +2 -2
  34. package/dist/blakron/display/Stage.js.map +1 -1
  35. package/dist/blakron/display/texture/BitmapData.d.ts.map +1 -1
  36. package/dist/blakron/display/texture/BitmapData.js +13 -26
  37. package/dist/blakron/display/texture/BitmapData.js.map +1 -1
  38. package/dist/blakron/display/texture/RenderTexture.js +1 -1
  39. package/dist/blakron/display/texture/RenderTexture.js.map +1 -1
  40. package/dist/blakron/events/Event.d.ts.map +1 -1
  41. package/dist/blakron/events/Event.js +1 -0
  42. package/dist/blakron/events/Event.js.map +1 -1
  43. package/dist/blakron/events/EventDispatcher.d.ts.map +1 -1
  44. package/dist/blakron/events/EventDispatcher.js +13 -12
  45. package/dist/blakron/events/EventDispatcher.js.map +1 -1
  46. package/dist/blakron/events/TouchEvent.js +2 -2
  47. package/dist/blakron/events/TouchEvent.js.map +1 -1
  48. package/dist/blakron/filters/ColorMatrixFilter.d.ts +1 -1
  49. package/dist/blakron/filters/ColorMatrixFilter.d.ts.map +1 -1
  50. package/dist/blakron/filters/ColorMatrixFilter.js +3 -3
  51. package/dist/blakron/filters/ColorMatrixFilter.js.map +1 -1
  52. package/dist/blakron/media/Sound.d.ts +1 -0
  53. package/dist/blakron/media/Sound.d.ts.map +1 -1
  54. package/dist/blakron/media/Sound.js +23 -5
  55. package/dist/blakron/media/Sound.js.map +1 -1
  56. package/dist/blakron/media/Video.d.ts +1 -1
  57. package/dist/blakron/media/Video.d.ts.map +1 -1
  58. package/dist/blakron/media/Video.js +5 -5
  59. package/dist/blakron/media/Video.js.map +1 -1
  60. package/dist/blakron/net/HttpMethod.d.ts +6 -0
  61. package/dist/blakron/net/HttpMethod.d.ts.map +1 -1
  62. package/dist/blakron/net/HttpMethod.js +5 -0
  63. package/dist/blakron/net/HttpMethod.js.map +1 -1
  64. package/dist/blakron/net/HttpRequest.d.ts +40 -0
  65. package/dist/blakron/net/HttpRequest.d.ts.map +1 -1
  66. package/dist/blakron/net/HttpRequest.js +60 -2
  67. package/dist/blakron/net/HttpRequest.js.map +1 -1
  68. package/dist/blakron/net/HttpResponseType.d.ts +6 -0
  69. package/dist/blakron/net/HttpResponseType.d.ts.map +1 -1
  70. package/dist/blakron/net/HttpResponseType.js +5 -0
  71. package/dist/blakron/net/HttpResponseType.js.map +1 -1
  72. package/dist/blakron/net/ImageLoader.d.ts +18 -0
  73. package/dist/blakron/net/ImageLoader.d.ts.map +1 -1
  74. package/dist/blakron/net/ImageLoader.js +26 -4
  75. package/dist/blakron/net/ImageLoader.js.map +1 -1
  76. package/dist/blakron/player/Player.d.ts.map +1 -1
  77. package/dist/blakron/player/Player.js +18 -6
  78. package/dist/blakron/player/Player.js.map +1 -1
  79. package/dist/blakron/player/RenderPipe.d.ts +1 -1
  80. package/dist/blakron/player/SystemTicker.js +2 -2
  81. package/dist/blakron/player/SystemTicker.js.map +1 -1
  82. package/dist/blakron/player/TouchHandler.js +1 -1
  83. package/dist/blakron/player/TouchHandler.js.map +1 -1
  84. package/dist/blakron/player/canvas/CanvasRenderer.js +52 -52
  85. package/dist/blakron/player/canvas/CanvasRenderer.js.map +1 -1
  86. package/dist/blakron/player/canvas/DisplayList.js +1 -1
  87. package/dist/blakron/player/canvas/DisplayList.js.map +1 -1
  88. package/dist/blakron/player/webgl/WebGLRenderContext.d.ts +2 -5
  89. package/dist/blakron/player/webgl/WebGLRenderContext.d.ts.map +1 -1
  90. package/dist/blakron/player/webgl/WebGLRenderContext.js +3 -11
  91. package/dist/blakron/player/webgl/WebGLRenderContext.js.map +1 -1
  92. package/dist/blakron/player/webgl/WebGLRenderer.d.ts +107 -4
  93. package/dist/blakron/player/webgl/WebGLRenderer.d.ts.map +1 -1
  94. package/dist/blakron/player/webgl/WebGLRenderer.js +194 -91
  95. package/dist/blakron/player/webgl/WebGLRenderer.js.map +1 -1
  96. package/dist/blakron/player/webgl/pipes/FilterPipe.js +7 -7
  97. package/dist/blakron/player/webgl/pipes/FilterPipe.js.map +1 -1
  98. package/dist/blakron/player/webgl/pipes/GraphicsPipe.js +1 -1
  99. package/dist/blakron/player/webgl/pipes/GraphicsPipe.js.map +1 -1
  100. package/dist/blakron/player/webgl/pipes/MaskPipe.js +12 -12
  101. package/dist/blakron/player/webgl/pipes/MaskPipe.js.map +1 -1
  102. package/dist/blakron/player/webgl/pipes/ParticlePipe.js +1 -1
  103. package/dist/blakron/player/webgl/pipes/ParticlePipe.js.map +1 -1
  104. package/dist/blakron/player/webgl/pipes/TextPipe.d.ts +3 -1
  105. package/dist/blakron/player/webgl/pipes/TextPipe.d.ts.map +1 -1
  106. package/dist/blakron/player/webgl/pipes/TextPipe.js +42 -5
  107. package/dist/blakron/player/webgl/pipes/TextPipe.js.map +1 -1
  108. package/dist/blakron/resource/Resource.d.ts +16 -4
  109. package/dist/blakron/resource/Resource.d.ts.map +1 -1
  110. package/dist/blakron/resource/Resource.js +30 -20
  111. package/dist/blakron/resource/Resource.js.map +1 -1
  112. package/dist/blakron/resource/ResourceLoader.d.ts +20 -0
  113. package/dist/blakron/resource/ResourceLoader.d.ts.map +1 -1
  114. package/dist/blakron/resource/ResourceLoader.js +44 -16
  115. package/dist/blakron/resource/ResourceLoader.js.map +1 -1
  116. package/dist/blakron/system/Capabilities.d.ts +1 -1
  117. package/dist/blakron/system/Capabilities.d.ts.map +1 -1
  118. package/dist/blakron/system/Capabilities.js +1 -1
  119. package/dist/blakron/system/Capabilities.js.map +1 -1
  120. package/dist/blakron/text/BitmapText.d.ts +1 -1
  121. package/dist/blakron/text/BitmapText.d.ts.map +1 -1
  122. package/dist/blakron/text/BitmapText.js +11 -11
  123. package/dist/blakron/text/BitmapText.js.map +1 -1
  124. package/dist/blakron/text/InputController.js +1 -1
  125. package/dist/blakron/text/InputController.js.map +1 -1
  126. package/dist/blakron/text/TextField.d.ts +3 -3
  127. package/dist/blakron/text/TextField.d.ts.map +1 -1
  128. package/dist/blakron/text/TextField.js +33 -33
  129. package/dist/blakron/text/TextField.js.map +1 -1
  130. package/dist/blakron/utils/ByteArray.d.ts +0 -1
  131. package/dist/blakron/utils/ByteArray.d.ts.map +1 -1
  132. package/dist/blakron/utils/ByteArray.js +2 -5
  133. package/dist/blakron/utils/ByteArray.js.map +1 -1
  134. package/package.json +4 -6
@@ -17,108 +17,70 @@ function clampRotation(value) {
17
17
  export class DisplayObject extends EventDispatcher {
18
18
  // ── Static fields ─────────────────────────────────────────────────────────
19
19
  static defaultTouchEnabled = false;
20
- static enterFrameCallBackList = [];
21
- static renderCallBackList = [];
22
- static eventAddToStageList = [];
23
- static eventRemoveFromStageList = [];
20
+ static $enterFrameCallBackList = [];
21
+ static $renderCallBackList = [];
22
+ static $eventAddToStageList = [];
23
+ static $eventRemoveFromStageList = [];
24
24
  /**
25
25
  * @internal
26
- * Injected by Player at startup. Called when renderMode changes (visible,
26
+ * Injected by Player at startup. Called when $renderMode changes (visible,
27
27
  * filters, mask, blendMode) so the WebGLRenderer can mark its InstructionSet dirty.
28
+ *
29
+ * Single-Player engine: Player assigns this directly in its constructor and
30
+ * clears it in `destroy()`. There is intentionally no registration API.
28
31
  */
29
- static _onStructureChange;
32
+ static $onStructureChange;
30
33
  /**
31
34
  * @internal
32
35
  * Injected by Player at startup. Called when a DisplayObject's visual data
33
36
  * changes (position, texture, alpha, tint) but the scene structure is unchanged.
34
37
  * The renderer uses this to update the transform snapshot in the InstructionSet
35
38
  * without doing a full rebuild.
39
+ *
40
+ * Single-Player engine: Player assigns this directly in its constructor and
41
+ * clears it in `destroy()`. There is intentionally no registration API.
36
42
  */
37
- static _onRenderableDirty;
38
- /**
39
- * @internal Register a structure-change listener. Returns an unregister function.
40
- * Using a registration pattern instead of a single static field supports
41
- * multiple Player instances on the same page.
42
- */
43
- static addStructureChangeListener(fn) {
44
- const prev = DisplayObject._onStructureChange;
45
- if (!prev) {
46
- DisplayObject._onStructureChange = fn;
47
- }
48
- else {
49
- DisplayObject._onStructureChange = () => {
50
- prev();
51
- fn();
52
- };
53
- }
54
- return () => {
55
- // Simple removal: if only one listener, clear; otherwise rebuild chain.
56
- // For the common single-player case this is zero overhead.
57
- if (DisplayObject._onStructureChange === fn) {
58
- DisplayObject._onStructureChange = undefined;
59
- }
60
- };
61
- }
62
- /**
63
- * @internal Register a renderable-dirty listener. Returns an unregister function.
64
- */
65
- static addRenderableDirtyListener(fn) {
66
- const prev = DisplayObject._onRenderableDirty;
67
- if (!prev) {
68
- DisplayObject._onRenderableDirty = fn;
69
- }
70
- else {
71
- DisplayObject._onRenderableDirty = obj => {
72
- prev(obj);
73
- fn(obj);
74
- };
75
- }
76
- return () => {
77
- if (DisplayObject._onRenderableDirty === fn) {
78
- DisplayObject._onRenderableDirty = undefined;
79
- }
80
- };
81
- }
43
+ static $onRenderableDirty;
82
44
  // ── Instance fields ───────────────────────────────────────────────────────
83
45
  // 场景图
84
- hasAddToStage = false;
85
- children;
86
- internalParent;
87
- internalStage;
88
- nestLevel = 0;
46
+ $hasAddToStage = false;
47
+ $children;
48
+ $parent;
49
+ $stage;
50
+ $nestLevel = 0;
89
51
  // 变换
90
- internalX = 0;
91
- internalY = 0;
92
- internalAnchorOffsetX = 0;
93
- internalAnchorOffsetY = 0;
94
- explicitWidth = NaN;
95
- explicitHeight = NaN;
96
- useTranslate = false;
52
+ $x = 0;
53
+ $y = 0;
54
+ $anchorOffsetX = 0;
55
+ $anchorOffsetY = 0;
56
+ $explicitWidth = NaN;
57
+ $explicitHeight = NaN;
58
+ $useTranslate = false;
97
59
  // 外观
98
- internalVisible = true;
99
- internalAlpha = 1;
100
- internalBlendMode = 0;
101
- internalFilters = [];
102
- internalCacheAsBitmap = false;
103
- internalTouchEnabled = DisplayObject.defaultTouchEnabled;
60
+ $visible = true;
61
+ $alpha = 1;
62
+ $blendMode = 0;
63
+ $filters = [];
64
+ $cacheAsBitmap = false;
65
+ $touchEnabled = DisplayObject.defaultTouchEnabled;
104
66
  // 遮罩
105
- internalMask;
106
- internalMaskRect;
107
- internalScrollRect;
108
- maskedObject;
67
+ $mask;
68
+ $maskRect;
69
+ $scrollRect;
70
+ $maskedObject;
109
71
  // 渲染状态
110
- renderMode;
111
- renderObjectType = 0 /* RenderObjectType.NONE */;
112
- renderDirty = false;
113
- cacheDirty = false;
114
- displayList;
115
- // 世界缓存(markDirty 更新,O(1) 读取)
116
- worldAlpha = 1;
117
- worldTint = 0xffffff;
118
- tintRGB = 0;
72
+ $renderMode;
73
+ $renderObjectType = 0 /* RenderObjectType.NONE */;
74
+ $renderDirty = false;
75
+ $cacheDirty = false;
76
+ $displayList;
77
+ // 世界缓存($markDirty 更新,O(1) 读取)
78
+ $worldAlpha = 1;
79
+ $worldTint = 0xffffff;
80
+ $tintRGB = 0;
119
81
  // 排序
120
- sortDirty = false;
121
- lastSortedIndex = 0;
82
+ $sortDirty = false;
83
+ $lastSortedIndex = 0;
122
84
  // bounds 缓存
123
85
  _boundsDirty = true;
124
86
  _cachedBounds = new Rectangle();
@@ -155,153 +117,153 @@ export class DisplayObject extends EventDispatcher {
155
117
  this._name = value;
156
118
  }
157
119
  get parent() {
158
- return this.internalParent;
120
+ return this.$parent;
159
121
  }
160
122
  get stage() {
161
- return this.internalStage;
123
+ return this.$stage;
162
124
  }
163
125
  get matrix() {
164
- return this.getMatrix().clone();
126
+ return this.$getMatrix().clone();
165
127
  }
166
128
  set matrix(value) {
167
- this.setMatrix(value);
129
+ this.$setMatrix(value);
168
130
  }
169
131
  get x() {
170
- return this.internalX;
132
+ return this.$x;
171
133
  }
172
134
  set x(value) {
173
- this.setX(value);
135
+ this.$setX(value);
174
136
  }
175
137
  get y() {
176
- return this.internalY;
138
+ return this.$y;
177
139
  }
178
140
  set y(value) {
179
- this.setY(value);
141
+ this.$setY(value);
180
142
  }
181
143
  get scaleX() {
182
144
  return this._scaleX;
183
145
  }
184
146
  set scaleX(value) {
185
- this.setScaleX(value);
147
+ this.$setScaleX(value);
186
148
  }
187
149
  get scaleY() {
188
150
  return this._scaleY;
189
151
  }
190
152
  set scaleY(value) {
191
- this.setScaleY(value);
153
+ this.$setScaleY(value);
192
154
  }
193
155
  get rotation() {
194
156
  return this._rotation;
195
157
  }
196
158
  set rotation(value) {
197
- this.setRotation(value);
159
+ this.$setRotation(value);
198
160
  }
199
161
  get skewX() {
200
162
  return this._skewXdeg;
201
163
  }
202
164
  set skewX(value) {
203
- this.setSkewX(value);
165
+ this.$setSkewX(value);
204
166
  }
205
167
  get skewY() {
206
168
  return this._skewYdeg;
207
169
  }
208
170
  set skewY(value) {
209
- this.setSkewY(value);
171
+ this.$setSkewY(value);
210
172
  }
211
173
  get width() {
212
- return isNaN(this.explicitWidth) ? this.getOriginalBounds().width : this.explicitWidth;
174
+ return isNaN(this.$explicitWidth) ? this.$getOriginalBounds().width : this.$explicitWidth;
213
175
  }
214
176
  set width(value) {
215
- this.explicitWidth = isNaN(value) ? NaN : value;
177
+ this.$explicitWidth = isNaN(value) ? NaN : value;
216
178
  }
217
179
  get height() {
218
- return isNaN(this.explicitHeight) ? this.getOriginalBounds().height : this.explicitHeight;
180
+ return isNaN(this.$explicitHeight) ? this.$getOriginalBounds().height : this.$explicitHeight;
219
181
  }
220
182
  set height(value) {
221
- this.explicitHeight = isNaN(value) ? NaN : value;
183
+ this.$explicitHeight = isNaN(value) ? NaN : value;
222
184
  }
223
185
  get measuredWidth() {
224
- return this.getOriginalBounds().width;
186
+ return this.$getOriginalBounds().width;
225
187
  }
226
188
  get measuredHeight() {
227
- return this.getOriginalBounds().height;
189
+ return this.$getOriginalBounds().height;
228
190
  }
229
191
  get anchorOffsetX() {
230
- return this.internalAnchorOffsetX;
192
+ return this.$anchorOffsetX;
231
193
  }
232
194
  set anchorOffsetX(value) {
233
- this.setAnchorOffsetX(value);
195
+ this.$setAnchorOffsetX(value);
234
196
  }
235
197
  get anchorOffsetY() {
236
- return this.internalAnchorOffsetY;
198
+ return this.$anchorOffsetY;
237
199
  }
238
200
  set anchorOffsetY(value) {
239
- this.setAnchorOffsetY(value);
201
+ this.$setAnchorOffsetY(value);
240
202
  }
241
203
  get visible() {
242
- return this.internalVisible;
204
+ return this.$visible;
243
205
  }
244
206
  set visible(value) {
245
- this.setVisible(value);
207
+ this.$setVisible(value);
246
208
  }
247
209
  get cacheAsBitmap() {
248
- return this.internalCacheAsBitmap;
210
+ return this.$cacheAsBitmap;
249
211
  }
250
212
  set cacheAsBitmap(value) {
251
- this.internalCacheAsBitmap = value;
252
- this.setHasDisplayList(value);
213
+ this.$cacheAsBitmap = value;
214
+ this.$setHasDisplayList(value);
253
215
  }
254
216
  get filters() {
255
- return this.internalFilters;
217
+ return this.$filters;
256
218
  }
257
219
  set filters(value) {
258
- this.internalFilters = value ? [...value] : [];
259
- this.updateRenderMode();
260
- this.markDirty();
220
+ this.$filters = value ? [...value] : [];
221
+ this.$updateRenderMode();
222
+ this.$markDirty();
261
223
  }
262
224
  get alpha() {
263
- return this.internalAlpha;
225
+ return this.$alpha;
264
226
  }
265
227
  set alpha(value) {
266
- this.setAlpha(value);
228
+ this.$setAlpha(value);
267
229
  }
268
230
  get touchEnabled() {
269
- return this.internalTouchEnabled;
231
+ return this.$touchEnabled;
270
232
  }
271
233
  set touchEnabled(value) {
272
- this.internalTouchEnabled = !!value;
234
+ this.$touchEnabled = !!value;
273
235
  }
274
236
  get scrollRect() {
275
- return this.internalScrollRect;
237
+ return this.$scrollRect;
276
238
  }
277
239
  set scrollRect(value) {
278
- this.setScrollRect(value);
240
+ this.$setScrollRect(value);
279
241
  }
280
242
  get blendMode() {
281
- return numberToBlendMode(this.internalBlendMode);
243
+ return numberToBlendMode(this.$blendMode);
282
244
  }
283
245
  set blendMode(value) {
284
246
  const mode = blendModeToNumber(value);
285
- if (this.internalBlendMode === mode) {
247
+ if (this.$blendMode === mode) {
286
248
  return;
287
249
  }
288
- this.internalBlendMode = mode;
289
- this.updateRenderMode();
290
- this.markDirty();
250
+ this.$blendMode = mode;
251
+ this.$updateRenderMode();
252
+ this.$markDirty();
291
253
  }
292
254
  get mask() {
293
- return this.internalMask ?? this.internalMaskRect;
255
+ return this.$mask ?? this.$maskRect;
294
256
  }
295
257
  set mask(value) {
296
- this.setMask(value);
258
+ this.$setMask(value);
297
259
  }
298
260
  get tint() {
299
261
  return this._tint;
300
262
  }
301
263
  set tint(value) {
302
264
  this._tint = typeof value === 'number' && value >= 0 && value <= 0xffffff ? value : 0xffffff;
303
- this.tintRGB = (this._tint >> 16) + (this._tint & 0xff00) + ((this._tint & 0xff) << 16);
304
- this.markDirty();
265
+ this.$tintRGB = (this._tint >> 16) + (this._tint & 0xff00) + ((this._tint & 0xff) << 16);
266
+ this.$markDirty();
305
267
  }
306
268
  get zIndex() {
307
269
  return this._zIndex;
@@ -309,7 +271,7 @@ export class DisplayObject extends EventDispatcher {
309
271
  set zIndex(value) {
310
272
  this._zIndex = value;
311
273
  if (this.parent) {
312
- this.parent.sortDirty = true;
274
+ this.parent.$sortDirty = true;
313
275
  }
314
276
  }
315
277
  get sortableChildren() {
@@ -320,58 +282,58 @@ export class DisplayObject extends EventDispatcher {
320
282
  }
321
283
  // ── Public methods ────────────────────────────────────────────────────────
322
284
  getBounds(resultRect, calculateAnchor = true) {
323
- resultRect = this.getTransformedBoundsInternal(this, resultRect);
285
+ resultRect = this.$getTransformedBoundsInternal(this, resultRect);
324
286
  if (calculateAnchor) {
325
- if (this.internalAnchorOffsetX !== 0) {
326
- resultRect.x -= this.internalAnchorOffsetX;
287
+ if (this.$anchorOffsetX !== 0) {
288
+ resultRect.x -= this.$anchorOffsetX;
327
289
  }
328
- if (this.internalAnchorOffsetY !== 0) {
329
- resultRect.y -= this.internalAnchorOffsetY;
290
+ if (this.$anchorOffsetY !== 0) {
291
+ resultRect.y -= this.$anchorOffsetY;
330
292
  }
331
293
  }
332
294
  return resultRect;
333
295
  }
334
296
  getTransformedBounds(targetCoordinateSpace, resultRect) {
335
- return this.getTransformedBoundsInternal(targetCoordinateSpace ?? this, resultRect);
297
+ return this.$getTransformedBoundsInternal(targetCoordinateSpace ?? this, resultRect);
336
298
  }
337
299
  globalToLocal(stageX = 0, stageY = 0, resultPoint) {
338
- return this.getInvertedConcatenatedMatrix().transformPoint(stageX, stageY, resultPoint);
300
+ return this.$getInvertedConcatenatedMatrix().transformPoint(stageX, stageY, resultPoint);
339
301
  }
340
302
  localToGlobal(localX = 0, localY = 0, resultPoint) {
341
- return this.getConcatenatedMatrix().transformPoint(localX, localY, resultPoint);
303
+ return this.$getConcatenatedMatrix().transformPoint(localX, localY, resultPoint);
342
304
  }
343
305
  hitTestPoint(x, y, shapeFlag) {
344
306
  if (this._scaleX === 0 || this._scaleY === 0) {
345
307
  return false;
346
308
  }
347
- const m = this.getInvertedConcatenatedMatrix();
309
+ const m = this.$getInvertedConcatenatedMatrix();
348
310
  const bounds = this.getBounds(undefined, false);
349
311
  const localX = m.a * x + m.c * y + m.tx;
350
312
  const localY = m.b * x + m.d * y + m.ty;
351
313
  if (!bounds.contains(localX, localY)) {
352
314
  return false;
353
315
  }
354
- const rect = this.internalScrollRect ?? this.internalMaskRect;
316
+ const rect = this.$scrollRect ?? this.$maskRect;
355
317
  if (rect && !rect.contains(localX, localY)) {
356
318
  return false;
357
319
  }
358
320
  if (!shapeFlag) {
359
321
  return true;
360
322
  }
361
- // Pixel-perfect: delegate to hitTest which Shape/Sprite override
362
- return this.hitTest(x, y) !== undefined;
323
+ // Pixel-perfect: delegate to $hitTest which Shape/Sprite override
324
+ return this.$hitTest(x, y) !== undefined;
363
325
  }
364
326
  sortChildren() {
365
- this.sortDirty = false;
327
+ this.$sortDirty = false;
366
328
  }
367
329
  dispatchEvent(event) {
368
330
  if (!event.bubbles) {
369
331
  return super.dispatchEvent(event);
370
332
  }
371
- const list = this.getPropagationList(this);
333
+ const list = this.$getPropagationList(this);
372
334
  const targetIndex = list.length * 0.5;
373
335
  event.setDispatchContext(this, 2 /* EventPhase.AT_TARGET */);
374
- this.dispatchPropagationEvent(event, list, targetIndex);
336
+ this.$dispatchPropagationEvent(event, list, targetIndex);
375
337
  return !event.isDefaultPrevented();
376
338
  }
377
339
  willTrigger(type) {
@@ -380,14 +342,14 @@ export class DisplayObject extends EventDispatcher {
380
342
  if (node.hasEventListener(type)) {
381
343
  return true;
382
344
  }
383
- node = node.internalParent;
345
+ node = node.$parent;
384
346
  }
385
347
  return false;
386
348
  }
387
349
  addEventListener(type, listener, useCapture, priority) {
388
350
  super.addEventListener(type, listener, useCapture, priority);
389
351
  if (type === Event.ENTER_FRAME || type === Event.RENDER) {
390
- const list = type === Event.ENTER_FRAME ? DisplayObject.enterFrameCallBackList : DisplayObject.renderCallBackList;
352
+ const list = type === Event.ENTER_FRAME ? DisplayObject.$enterFrameCallBackList : DisplayObject.$renderCallBackList;
391
353
  if (!list.includes(this)) {
392
354
  list.push(this);
393
355
  }
@@ -396,7 +358,7 @@ export class DisplayObject extends EventDispatcher {
396
358
  removeEventListener(type, listener, useCapture) {
397
359
  super.removeEventListener(type, listener, useCapture);
398
360
  if ((type === Event.ENTER_FRAME || type === Event.RENDER) && !this.hasEventListener(type)) {
399
- const list = type === Event.ENTER_FRAME ? DisplayObject.enterFrameCallBackList : DisplayObject.renderCallBackList;
361
+ const list = type === Event.ENTER_FRAME ? DisplayObject.$enterFrameCallBackList : DisplayObject.$renderCallBackList;
400
362
  const index = list.indexOf(this);
401
363
  if (index !== -1) {
402
364
  list.splice(index, 1);
@@ -404,39 +366,39 @@ export class DisplayObject extends EventDispatcher {
404
366
  }
405
367
  }
406
368
  // ── Internal methods (used by subclasses and framework) ───────────────────
407
- setParent(parent) {
408
- this.internalParent = parent;
369
+ $setParent(parent) {
370
+ this.$parent = parent;
409
371
  }
410
- onAddToStage(stage, nestLevel) {
411
- this.internalStage = stage;
412
- this.nestLevel = nestLevel;
413
- this.hasAddToStage = true;
414
- DisplayObject.eventAddToStageList.push(this);
372
+ $onAddToStage(stage, $nestLevel) {
373
+ this.$stage = stage;
374
+ this.$nestLevel = $nestLevel;
375
+ this.$hasAddToStage = true;
376
+ DisplayObject.$eventAddToStageList.push(this);
415
377
  }
416
- onRemoveFromStage() {
417
- this.nestLevel = 0;
418
- this.internalStage = undefined;
419
- DisplayObject.eventRemoveFromStageList.push(this);
378
+ $onRemoveFromStage() {
379
+ this.$nestLevel = 0;
380
+ this.$stage = undefined;
381
+ DisplayObject.$eventRemoveFromStageList.push(this);
420
382
  }
421
- getMatrix() {
383
+ $getMatrix() {
422
384
  if (this._matrixDirty) {
423
385
  this._matrixDirty = false;
424
386
  this._matrix.updateScaleAndRotation(this._scaleX, this._scaleY, this._skewX, this._skewY);
425
387
  }
426
- this._matrix.tx = this.internalX;
427
- this._matrix.ty = this.internalY;
388
+ this._matrix.tx = this.$x;
389
+ this._matrix.ty = this.$y;
428
390
  return this._matrix;
429
391
  }
430
- setMatrix(matrix, needUpdateProperties = true) {
392
+ $setMatrix(matrix, needUpdateProperties = true) {
431
393
  const m = this._matrix;
432
394
  m.a = matrix.a;
433
395
  m.b = matrix.b;
434
396
  m.c = matrix.c;
435
397
  m.d = matrix.d;
436
- this.internalX = matrix.tx;
437
- this.internalY = matrix.ty;
398
+ this.$x = matrix.tx;
399
+ this.$y = matrix.ty;
438
400
  this._matrixDirty = false;
439
- this.useTranslate = !(m.a === 1 && m.b === 0 && m.c === 0 && m.d === 1);
401
+ this.$useTranslate = !(m.a === 1 && m.b === 0 && m.c === 0 && m.d === 1);
440
402
  if (needUpdateProperties) {
441
403
  this._scaleX = m.getScaleX();
442
404
  this._scaleY = m.getScaleY();
@@ -446,22 +408,22 @@ export class DisplayObject extends EventDispatcher {
446
408
  this._skewYdeg = clampRotation((this._skewY * 180) / Math.PI);
447
409
  this._rotation = clampRotation((this._skewY * 180) / Math.PI);
448
410
  }
449
- this.markDirty();
411
+ this.$markDirty();
450
412
  }
451
- getConcatenatedMatrix() {
413
+ $getConcatenatedMatrix() {
452
414
  if (!this._concatenatedMatrix) {
453
415
  this._concatenatedMatrix = new Matrix();
454
416
  }
455
417
  const matrix = this._concatenatedMatrix;
456
- if (this.internalParent) {
457
- this.internalParent.getConcatenatedMatrix().preMultiplyInto(this.getMatrix(), matrix);
418
+ if (this.$parent) {
419
+ this.$parent.$getConcatenatedMatrix().preMultiplyInto(this.$getMatrix(), matrix);
458
420
  }
459
421
  else {
460
- matrix.copyFrom(this.getMatrix());
422
+ matrix.copyFrom(this.$getMatrix());
461
423
  }
462
- const ox = this.internalAnchorOffsetX;
463
- const oy = this.internalAnchorOffsetY;
464
- const rect = this.internalScrollRect;
424
+ const ox = this.$anchorOffsetX;
425
+ const oy = this.$anchorOffsetY;
426
+ const rect = this.$scrollRect;
465
427
  if (rect) {
466
428
  matrix.preMultiplyInto(sharedMatrix.setTo(1, 0, 0, 1, -rect.x - ox, -rect.y - oy), matrix);
467
429
  }
@@ -470,48 +432,48 @@ export class DisplayObject extends EventDispatcher {
470
432
  }
471
433
  return matrix;
472
434
  }
473
- getInvertedConcatenatedMatrix() {
435
+ $getInvertedConcatenatedMatrix() {
474
436
  if (!this._invertedConcatenatedMatrix) {
475
437
  this._invertedConcatenatedMatrix = new Matrix();
476
438
  }
477
- this.getConcatenatedMatrix().invertInto(this._invertedConcatenatedMatrix);
439
+ this.$getConcatenatedMatrix().invertInto(this._invertedConcatenatedMatrix);
478
440
  return this._invertedConcatenatedMatrix;
479
441
  }
480
- setX(value) {
481
- if (this.internalX === value) {
442
+ $setX(value) {
443
+ if (this.$x === value) {
482
444
  return false;
483
445
  }
484
- this.internalX = value;
485
- this.markDirty();
446
+ this.$x = value;
447
+ this.$markDirty();
486
448
  return true;
487
449
  }
488
- setY(value) {
489
- if (this.internalY === value) {
450
+ $setY(value) {
451
+ if (this.$y === value) {
490
452
  return false;
491
453
  }
492
- this.internalY = value;
493
- this.markDirty();
454
+ this.$y = value;
455
+ this.$markDirty();
494
456
  return true;
495
457
  }
496
- setScaleX(value) {
458
+ $setScaleX(value) {
497
459
  if (this._scaleX === value) {
498
460
  return;
499
461
  }
500
462
  this._scaleX = value;
501
463
  this._matrixDirty = true;
502
- this.updateUseTransform();
503
- this.markDirty();
464
+ this.$updateUseTransform();
465
+ this.$markDirty();
504
466
  }
505
- setScaleY(value) {
467
+ $setScaleY(value) {
506
468
  if (this._scaleY === value) {
507
469
  return;
508
470
  }
509
471
  this._scaleY = value;
510
472
  this._matrixDirty = true;
511
- this.updateUseTransform();
512
- this.markDirty();
473
+ this.$updateUseTransform();
474
+ this.$markDirty();
513
475
  }
514
- setRotation(value) {
476
+ $setRotation(value) {
515
477
  value = clampRotation(value);
516
478
  if (value === this._rotation) {
517
479
  return;
@@ -521,156 +483,156 @@ export class DisplayObject extends EventDispatcher {
521
483
  this._skewY += delta;
522
484
  this._rotation = value;
523
485
  this._matrixDirty = true;
524
- this.updateUseTransform();
525
- this.markDirty();
486
+ this.$updateUseTransform();
487
+ this.$markDirty();
526
488
  }
527
- setSkewX(value) {
489
+ $setSkewX(value) {
528
490
  if (value === this._skewXdeg) {
529
491
  return;
530
492
  }
531
493
  this._skewXdeg = value;
532
494
  this._skewX = (clampRotation(value) / 180) * Math.PI;
533
495
  this._matrixDirty = true;
534
- this.updateUseTransform();
535
- this.markDirty();
496
+ this.$updateUseTransform();
497
+ this.$markDirty();
536
498
  }
537
- setSkewY(value) {
499
+ $setSkewY(value) {
538
500
  if (value === this._skewYdeg) {
539
501
  return;
540
502
  }
541
503
  this._skewYdeg = value;
542
504
  this._skewY = ((clampRotation(value) + this._rotation) / 180) * Math.PI;
543
505
  this._matrixDirty = true;
544
- this.updateUseTransform();
545
- this.markDirty();
506
+ this.$updateUseTransform();
507
+ this.$markDirty();
546
508
  }
547
- setAnchorOffsetX(value) {
548
- if (this.internalAnchorOffsetX === value) {
509
+ $setAnchorOffsetX(value) {
510
+ if (this.$anchorOffsetX === value) {
549
511
  return;
550
512
  }
551
- this.internalAnchorOffsetX = value;
552
- this.markDirty();
513
+ this.$anchorOffsetX = value;
514
+ this.$markDirty();
553
515
  }
554
- setAnchorOffsetY(value) {
555
- if (this.internalAnchorOffsetY === value) {
516
+ $setAnchorOffsetY(value) {
517
+ if (this.$anchorOffsetY === value) {
556
518
  return;
557
519
  }
558
- this.internalAnchorOffsetY = value;
559
- this.markDirty();
520
+ this.$anchorOffsetY = value;
521
+ this.$markDirty();
560
522
  }
561
- setVisible(value) {
562
- if (this.internalVisible === value) {
523
+ $setVisible(value) {
524
+ if (this.$visible === value) {
563
525
  return;
564
526
  }
565
- this.internalVisible = value;
566
- this.updateRenderMode();
567
- this.markDirty();
527
+ this.$visible = value;
528
+ this.$updateRenderMode();
529
+ this.$markDirty();
568
530
  }
569
- setAlpha(value) {
570
- if (this.internalAlpha === value) {
531
+ $setAlpha(value) {
532
+ if (this.$alpha === value) {
571
533
  return;
572
534
  }
573
- this.internalAlpha = value;
574
- this.updateRenderMode();
575
- this.markDirty();
535
+ this.$alpha = value;
536
+ this.$updateRenderMode();
537
+ this.$markDirty();
576
538
  }
577
- setScrollRect(value) {
578
- if (!value && !this.internalScrollRect) {
539
+ $setScrollRect(value) {
540
+ if (!value && !this.$scrollRect) {
579
541
  return;
580
542
  }
581
543
  if (value) {
582
- if (!this.internalScrollRect) {
583
- this.internalScrollRect = new Rectangle();
544
+ if (!this.$scrollRect) {
545
+ this.$scrollRect = new Rectangle();
584
546
  }
585
- this.internalScrollRect.copyFrom(value);
547
+ this.$scrollRect.copyFrom(value);
586
548
  }
587
549
  else {
588
- this.internalScrollRect = undefined;
550
+ this.$scrollRect = undefined;
589
551
  }
590
- this.updateRenderMode();
591
- this.markDirty();
552
+ this.$updateRenderMode();
553
+ this.$markDirty();
592
554
  }
593
- setHasDisplayList(value) {
594
- const hasDisplayList = !!this.displayList;
555
+ $setHasDisplayList(value) {
556
+ const hasDisplayList = !!this.$displayList;
595
557
  if (hasDisplayList === value) {
596
558
  return;
597
559
  }
598
560
  if (value) {
599
561
  const dl = DisplayList.create(this);
600
562
  if (dl) {
601
- this.displayList = dl;
602
- this.cacheDirty = true;
563
+ this.$displayList = dl;
564
+ this.$cacheDirty = true;
603
565
  }
604
566
  }
605
567
  else {
606
- if (this.displayList) {
607
- DisplayList.release(this.displayList);
608
- this.displayList = undefined;
568
+ if (this.$displayList) {
569
+ DisplayList.release(this.$displayList);
570
+ this.$displayList = undefined;
609
571
  }
610
572
  }
611
573
  // cacheAsBitmap toggle changes the instruction set structure:
612
574
  // the subtree either collapses to a single displayListCache instruction
613
575
  // or expands back to individual leaf instructions.
614
- DisplayObject._onStructureChange?.();
615
- this.markDirty();
576
+ DisplayObject.$onStructureChange?.();
577
+ this.$markDirty();
616
578
  }
617
- cacheDirtyUp() {
618
- const p = this.internalParent;
619
- if (p && !p.cacheDirty) {
620
- p.cacheDirty = true;
579
+ $cacheDirtyUp() {
580
+ const p = this.$parent;
581
+ if (p && !p.$cacheDirty) {
582
+ p.$cacheDirty = true;
621
583
  p._boundsDirty = true;
622
- p.cacheDirtyUp();
584
+ p.$cacheDirtyUp();
623
585
  }
624
586
  }
625
- renderDirtyUp() {
626
- const p = this.internalParent;
627
- if (p && !p.renderDirty) {
628
- p.renderDirty = true;
629
- p.renderDirtyUp();
587
+ $renderDirtyUp() {
588
+ const p = this.$parent;
589
+ if (p && !p.$renderDirty) {
590
+ p.$renderDirty = true;
591
+ p.$renderDirtyUp();
630
592
  }
631
593
  }
632
- updateUseTransform() {
633
- this.useTranslate = !(this._scaleX === 1 && this._scaleY === 1 && this._skewX === 0 && this._skewY === 0);
594
+ $updateUseTransform() {
595
+ this.$useTranslate = !(this._scaleX === 1 && this._scaleY === 1 && this._skewX === 0 && this._skewY === 0);
634
596
  }
635
- updateRenderMode() {
636
- if (!this.internalVisible || this.internalAlpha <= 0 || this.maskedObject) {
637
- this.renderMode = 1 /* RenderMode.NONE */;
597
+ $updateRenderMode() {
598
+ if (!this.$visible || this.$alpha <= 0 || this.$maskedObject) {
599
+ this.$renderMode = 1 /* RenderMode.NONE */;
638
600
  }
639
- else if (this.internalFilters.length > 0) {
640
- this.renderMode = 2 /* RenderMode.FILTER */;
601
+ else if (this.$filters.length > 0) {
602
+ this.$renderMode = 2 /* RenderMode.FILTER */;
641
603
  }
642
- else if (this.internalBlendMode !== 0 || (this.internalMask && this.internalMask.internalStage)) {
643
- this.renderMode = 3 /* RenderMode.CLIP */;
604
+ else if (this.$blendMode !== 0 || (this.$mask && this.$mask.$stage)) {
605
+ this.$renderMode = 3 /* RenderMode.CLIP */;
644
606
  }
645
- else if (this.internalScrollRect || this.internalMaskRect) {
646
- this.renderMode = 4 /* RenderMode.SCROLLRECT */;
607
+ else if (this.$scrollRect || this.$maskRect) {
608
+ this.$renderMode = 4 /* RenderMode.SCROLLRECT */;
647
609
  }
648
610
  else {
649
- this.renderMode = undefined;
611
+ this.$renderMode = undefined;
650
612
  }
651
613
  // RenderMode change means the instruction set structure is stale.
652
- DisplayObject._onStructureChange?.();
614
+ DisplayObject.$onStructureChange?.();
653
615
  }
654
- getOriginalBounds() {
616
+ $getOriginalBounds() {
655
617
  if (!this._boundsDirty) {
656
618
  return this._cachedBounds;
657
619
  }
658
- const bounds = this.getContentBounds();
659
- this.measureChildBounds(bounds);
620
+ const bounds = this.$getContentBounds();
621
+ this.$measureChildBounds(bounds);
660
622
  this._cachedBounds.copyFrom(bounds);
661
623
  this._boundsDirty = false;
662
624
  return this._cachedBounds;
663
625
  }
664
- measureChildBounds(_bounds) { }
665
- getContentBounds() {
626
+ $measureChildBounds(_bounds) { }
627
+ $getContentBounds() {
666
628
  const bounds = sharedRectangle;
667
629
  bounds.setEmpty();
668
- this.measureContentBounds(bounds);
630
+ this.$measureContentBounds(bounds);
669
631
  return bounds;
670
632
  }
671
- measureContentBounds(_bounds) { }
672
- getTransformedBoundsInternal(targetCoordinateSpace, resultRect) {
673
- const bounds = this.getOriginalBounds();
633
+ $measureContentBounds(_bounds) { }
634
+ $getTransformedBoundsInternal(targetCoordinateSpace, resultRect) {
635
+ const bounds = this.$getOriginalBounds();
674
636
  if (!resultRect) {
675
637
  resultRect = new Rectangle();
676
638
  }
@@ -679,46 +641,46 @@ export class DisplayObject extends EventDispatcher {
679
641
  return resultRect;
680
642
  }
681
643
  const m = sharedMatrix;
682
- targetCoordinateSpace.getInvertedConcatenatedMatrix().preMultiplyInto(this.getConcatenatedMatrix(), m);
644
+ targetCoordinateSpace.$getInvertedConcatenatedMatrix().preMultiplyInto(this.$getConcatenatedMatrix(), m);
683
645
  m.transformBounds(resultRect);
684
646
  return resultRect;
685
647
  }
686
- getConcatenatedMatrixAt(root, matrix) {
687
- const invertMatrix = root.getInvertedConcatenatedMatrix();
648
+ $getConcatenatedMatrixAt(root, matrix) {
649
+ const invertMatrix = root.$getInvertedConcatenatedMatrix();
688
650
  if ((invertMatrix.a === 0 || invertMatrix.d === 0) && (invertMatrix.b === 0 || invertMatrix.c === 0)) {
689
651
  let target = this;
690
- const rootLevel = root.nestLevel;
652
+ const rootLevel = root.$nestLevel;
691
653
  matrix.identity();
692
- while (target.nestLevel > rootLevel) {
693
- const rect = target.internalScrollRect;
654
+ while (target.$nestLevel > rootLevel) {
655
+ const rect = target.$scrollRect;
694
656
  if (rect)
695
657
  matrix.concat(sharedMatrix.setTo(1, 0, 0, 1, -rect.x, -rect.y));
696
- matrix.concat(target.getMatrix());
697
- target = target.internalParent;
658
+ matrix.concat(target.$getMatrix());
659
+ target = target.$parent;
698
660
  }
699
661
  }
700
662
  else {
701
663
  invertMatrix.preMultiplyInto(matrix, matrix);
702
664
  }
703
665
  }
704
- hitTest(stageX, stageY) {
705
- if (!this.internalVisible || this._scaleX === 0 || this._scaleY === 0) {
666
+ $hitTest(stageX, stageY) {
667
+ if (!this.$visible || this._scaleX === 0 || this._scaleY === 0) {
706
668
  return undefined;
707
669
  }
708
- const m = this.getInvertedConcatenatedMatrix();
670
+ const m = this.$getInvertedConcatenatedMatrix();
709
671
  if (m.a === 0 && m.b === 0 && m.c === 0 && m.d === 0) {
710
672
  return undefined;
711
673
  }
712
- const bounds = this.getContentBounds();
674
+ const bounds = this.$getContentBounds();
713
675
  const localX = m.a * stageX + m.c * stageY + m.tx;
714
676
  const localY = m.b * stageX + m.d * stageY + m.ty;
715
677
  if (bounds.contains(localX, localY)) {
716
- if (!this.children) {
717
- const rect = this.internalScrollRect ?? this.internalMaskRect;
678
+ if (!this.$children) {
679
+ const rect = this.$scrollRect ?? this.$maskRect;
718
680
  if (rect && !rect.contains(localX, localY)) {
719
681
  return undefined;
720
682
  }
721
- if (this.internalMask && !this.internalMask.hitTest(stageX, stageY)) {
683
+ if (this.$mask && !this.$mask.$hitTest(stageX, stageY)) {
722
684
  return undefined;
723
685
  }
724
686
  }
@@ -726,17 +688,17 @@ export class DisplayObject extends EventDispatcher {
726
688
  }
727
689
  return undefined;
728
690
  }
729
- updateRenderNode() { }
730
- getPropagationList(target) {
691
+ $updateRenderNode() { }
692
+ $getPropagationList(target) {
731
693
  const list = [];
732
694
  let current = target;
733
695
  while (current) {
734
696
  list.push(current);
735
- current = current.internalParent;
697
+ current = current.$parent;
736
698
  }
737
699
  return [...[...list].reverse(), ...list];
738
700
  }
739
- dispatchPropagationEvent(event, list, targetIndex) {
701
+ $dispatchPropagationEvent(event, list, targetIndex) {
740
702
  for (let i = 0; i < list.length; i++) {
741
703
  const currentTarget = list[i];
742
704
  let phase;
@@ -758,73 +720,73 @@ export class DisplayObject extends EventDispatcher {
758
720
  }
759
721
  }
760
722
  // ── Private methods ───────────────────────────────────────────────────────
761
- setMask(value) {
723
+ $setMask(value) {
762
724
  if (value === this) {
763
725
  return;
764
726
  }
765
727
  if (value instanceof DisplayObject) {
766
- if (value === this.internalMask) {
728
+ if (value === this.$mask) {
767
729
  return;
768
730
  }
769
- if (value.maskedObject) {
770
- value.maskedObject.mask = undefined;
731
+ if (value.$maskedObject) {
732
+ value.$maskedObject.mask = undefined;
771
733
  }
772
- value.maskedObject = this;
773
- this.internalMask = value;
774
- this.internalMaskRect = undefined;
734
+ value.$maskedObject = this;
735
+ this.$mask = value;
736
+ this.$maskRect = undefined;
775
737
  }
776
738
  else if (value instanceof Rectangle) {
777
- if (!this.internalMaskRect) {
778
- this.internalMaskRect = new Rectangle();
739
+ if (!this.$maskRect) {
740
+ this.$maskRect = new Rectangle();
779
741
  }
780
- this.internalMaskRect.copyFrom(value);
781
- if (this.internalMask) {
782
- this.internalMask.maskedObject = undefined;
783
- this.internalMask = undefined;
742
+ this.$maskRect.copyFrom(value);
743
+ if (this.$mask) {
744
+ this.$mask.$maskedObject = undefined;
745
+ this.$mask = undefined;
784
746
  }
785
747
  }
786
748
  else {
787
- if (this.internalMask) {
788
- this.internalMask.maskedObject = undefined;
789
- this.internalMask = undefined;
749
+ if (this.$mask) {
750
+ this.$mask.$maskedObject = undefined;
751
+ this.$mask = undefined;
790
752
  }
791
- this.internalMaskRect = undefined;
753
+ this.$maskRect = undefined;
792
754
  }
793
- this.updateRenderMode();
794
- this.markDirty();
755
+ this.$updateRenderMode();
756
+ this.$markDirty();
795
757
  }
796
- markDirty() {
797
- this.renderDirty = true;
758
+ $markDirty() {
759
+ this.$renderDirty = true;
798
760
  this._boundsDirty = true;
799
761
  // Update cached world alpha and tint so _refreshLeafTransform can read
800
762
  // them in O(1) without walking the parent chain.
801
- let alpha = this.internalAlpha;
802
- let tint = this.tintRGB;
803
- let p = this.internalParent;
763
+ let alpha = this.$alpha;
764
+ let tint = this.$tintRGB;
765
+ let p = this.$parent;
804
766
  while (p) {
805
- alpha *= p.internalAlpha;
806
- if (p.tintRGB !== 0xffffff) {
807
- tint = p.tintRGB;
767
+ alpha *= p.$alpha;
768
+ if (p.$tintRGB !== 0xffffff) {
769
+ tint = p.$tintRGB;
808
770
  }
809
- p = p.internalParent;
771
+ p = p.$parent;
810
772
  }
811
- this.worldAlpha = alpha;
812
- this.worldTint = tint;
773
+ this.$worldAlpha = alpha;
774
+ this.$worldTint = tint;
813
775
  // Notify the renderer that this object's data changed.
814
- DisplayObject._onRenderableDirty?.(this);
815
- const parent = this.internalParent;
816
- if (parent && !parent.cacheDirty) {
817
- parent.cacheDirty = true;
818
- parent.cacheDirtyUp();
819
- }
820
- if (parent && !parent.renderDirty) {
821
- parent.renderDirty = true;
822
- parent.renderDirtyUp();
823
- }
824
- const masked = this.maskedObject;
825
- if (masked && !masked.cacheDirty) {
826
- masked.cacheDirty = true;
827
- masked.cacheDirtyUp();
776
+ DisplayObject.$onRenderableDirty?.(this);
777
+ const parent = this.$parent;
778
+ if (parent && !parent.$cacheDirty) {
779
+ parent.$cacheDirty = true;
780
+ parent.$cacheDirtyUp();
781
+ }
782
+ if (parent && !parent.$renderDirty) {
783
+ parent.$renderDirty = true;
784
+ parent.$renderDirtyUp();
785
+ }
786
+ const masked = this.$maskedObject;
787
+ if (masked && !masked.$cacheDirty) {
788
+ masked.$cacheDirty = true;
789
+ masked.$cacheDirtyUp();
828
790
  }
829
791
  }
830
792
  }