@awayjs/scene 0.13.246 → 0.13.248

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 (57) hide show
  1. package/bundle/awayjs-scene.umd.js +103 -223
  2. package/bundle/awayjs-scene.umd.js.map +1 -1
  3. package/bundle/awayjs-scene.umd.min.js.map +1 -1
  4. package/bundle/awayjs-scene.umd.min.js.map.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/lib/display/Billboard.d.ts +2 -2
  7. package/dist/lib/display/Billboard.d.ts.map +1 -1
  8. package/dist/lib/display/Billboard.js +2 -2
  9. package/dist/lib/display/Camera.d.ts +0 -1
  10. package/dist/lib/display/Camera.d.ts.map +1 -1
  11. package/dist/lib/display/Camera.js +0 -3
  12. package/dist/lib/display/DisplayObject.d.ts +30 -8
  13. package/dist/lib/display/DisplayObject.d.ts.map +1 -1
  14. package/dist/lib/display/DisplayObject.js +40 -10
  15. package/dist/lib/display/DisplayObjectContainer.d.ts +2 -24
  16. package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
  17. package/dist/lib/display/DisplayObjectContainer.js +5 -37
  18. package/dist/lib/display/LineSegment.d.ts +2 -2
  19. package/dist/lib/display/LineSegment.d.ts.map +1 -1
  20. package/dist/lib/display/LineSegment.js +2 -2
  21. package/dist/lib/display/MorphSprite.d.ts +0 -1
  22. package/dist/lib/display/MorphSprite.d.ts.map +1 -1
  23. package/dist/lib/display/MorphSprite.js +1 -19
  24. package/dist/lib/display/MovieClip.d.ts.map +1 -1
  25. package/dist/lib/display/MovieClip.js +2 -3
  26. package/dist/lib/display/Skybox.d.ts +2 -2
  27. package/dist/lib/display/Skybox.d.ts.map +1 -1
  28. package/dist/lib/display/Skybox.js +2 -2
  29. package/dist/lib/display/Sprite.d.ts +2 -20
  30. package/dist/lib/display/Sprite.d.ts.map +1 -1
  31. package/dist/lib/display/Sprite.js +24 -66
  32. package/dist/lib/display/TextField.d.ts +2 -17
  33. package/dist/lib/display/TextField.d.ts.map +1 -1
  34. package/dist/lib/display/TextField.js +13 -72
  35. package/dist/lib/display/TextSprite.d.ts +1 -2
  36. package/dist/lib/display/TextSprite.d.ts.map +1 -1
  37. package/dist/lib/display/TextSprite.js +2 -2
  38. package/dist/lib/events/MouseEvent.d.ts +3 -3
  39. package/dist/lib/events/MouseEvent.d.ts.map +1 -1
  40. package/dist/lib/events/MouseEvent.js +3 -3
  41. package/dist/lib/managers/MouseManager.d.ts.map +1 -1
  42. package/dist/lib/managers/MouseManager.js +7 -7
  43. package/index.ts +1 -1
  44. package/lib/display/Billboard.ts +3 -2
  45. package/lib/display/Camera.ts +0 -4
  46. package/lib/display/DisplayObject.ts +46 -19
  47. package/lib/display/DisplayObjectContainer.ts +6 -38
  48. package/lib/display/LineSegment.ts +3 -3
  49. package/lib/display/MorphSprite.ts +2 -26
  50. package/lib/display/MovieClip.ts +2 -2
  51. package/lib/display/Skybox.ts +3 -3
  52. package/lib/display/Sprite.ts +20 -74
  53. package/lib/display/TextField.ts +19 -83
  54. package/lib/display/TextSprite.ts +3 -4
  55. package/lib/events/MouseEvent.ts +6 -6
  56. package/lib/managers/MouseManager.ts +8 -9
  57. package/package.json +1 -1
@@ -1290,6 +1290,7 @@ var DisplayObject = /** @class */ (function (_super) {
1290
1290
  */
1291
1291
  function DisplayObject() {
1292
1292
  var _this = _super.call(this) || this;
1293
+ _this._mouseChildren = true;
1293
1294
  _this._sessionID = -1;
1294
1295
  _this._avmDepthID = -1;
1295
1296
  //public _implicitPartition: PartitionBase;
@@ -2450,6 +2451,40 @@ var DisplayObject = /** @class */ (function (_super) {
2450
2451
  enumerable: true,
2451
2452
  configurable: true
2452
2453
  });
2454
+ Object.defineProperty(DisplayObject.prototype, "mouseChildren", {
2455
+ /**
2456
+ * Determines whether or not the children of the object are mouse, or user
2457
+ * input device, enabled. If an object is enabled, a user can interact with
2458
+ * it by using a mouse or user input device. The default is
2459
+ * <code>true</code>.
2460
+ *
2461
+ * <p>This property is useful when you create a button with an instance of
2462
+ * the Sprite class(instead of using the SimpleButton class). When you use a
2463
+ * Sprite instance to create a button, you can choose to decorate the button
2464
+ * by using the <code>addChild()</code> method to add additional Sprite
2465
+ * instances. This process can cause unexpected behavior with mouse events
2466
+ * because the Sprite instances you add as children can become the target
2467
+ * object of a mouse event when you expect the parent instance to be the
2468
+ * target object. To ensure that the parent instance serves as the target
2469
+ * objects for mouse events, you can set the <code>mouseChildren</code>
2470
+ * property of the parent instance to <code>false</code>.</p>
2471
+ *
2472
+ * <p> No event is dispatched by setting this property. You must use the
2473
+ * <code>addEventListener()</code> method to create interactive
2474
+ * functionality.</p>
2475
+ */
2476
+ get: function () {
2477
+ return this._mouseChildren;
2478
+ },
2479
+ set: function (value) {
2480
+ if (this._mouseChildren == value)
2481
+ return;
2482
+ this._mouseChildren = value;
2483
+ this._invalidateHierarchicalProperty(_awayjs_view.HierarchicalProperty.MOUSE_ENABLED);
2484
+ },
2485
+ enumerable: true,
2486
+ configurable: true
2487
+ });
2453
2488
  Object.defineProperty(DisplayObject.prototype, "x", {
2454
2489
  /**
2455
2490
  * Indicates the <i>x</i> coordinate of the DisplayObject instance relative
@@ -2531,9 +2566,10 @@ var DisplayObject = /** @class */ (function (_super) {
2531
2566
  DisplayObject.prototype.advanceFrame = function () {
2532
2567
  //default to do nothing
2533
2568
  };
2534
- DisplayObject.prototype.isEntity = function () {
2535
- return false;
2569
+ DisplayObject.prototype.getEntity = function () {
2570
+ return;
2536
2571
  };
2572
+ DisplayObject.prototype._initNode = function (node) { };
2537
2573
  /**
2538
2574
  *
2539
2575
  */
@@ -2547,6 +2583,7 @@ var DisplayObject = /** @class */ (function (_super) {
2547
2583
  displayObject.defaultBoundingVolume = this._defaultBoundingVolume;
2548
2584
  if (this._registrationMatrix3D)
2549
2585
  displayObject._registrationMatrix3D = this._registrationMatrix3D.clone();
2586
+ displayObject.mouseChildren = this._mouseChildren;
2550
2587
  displayObject.material = this._material;
2551
2588
  displayObject.style = this._style;
2552
2589
  displayObject.pickObject = this._pickObject;
@@ -2652,12 +2689,6 @@ var DisplayObject = /** @class */ (function (_super) {
2652
2689
  DisplayObject.prototype._invalidateHierarchicalProperty = function (propDirty) {
2653
2690
  this.dispatchEvent(new _awayjs_view.HeirarchicalEvent(_awayjs_view.HeirarchicalEvent.INVALIDATE_PROPERTY, propDirty));
2654
2691
  };
2655
- DisplayObject.prototype._invalidateEntity = function () {
2656
- this.dispatchEvent(new _awayjs_view.ContainerEvent(_awayjs_view.ContainerEvent.INVALIDATE_ENTITY, this));
2657
- };
2658
- DisplayObject.prototype._clearEntity = function () {
2659
- this.dispatchEvent(new _awayjs_view.ContainerEvent(_awayjs_view.ContainerEvent.CLEAR_ENTITY, this));
2660
- };
2661
2692
  /**
2662
2693
  *
2663
2694
  */
@@ -2675,7 +2706,6 @@ var DisplayObject = /** @class */ (function (_super) {
2675
2706
  enumerable: true,
2676
2707
  configurable: true
2677
2708
  });
2678
- DisplayObject.prototype._acceptTraverser = function (_traverser) { };
2679
2709
  DisplayObject.prototype._setScaleX = function (val) {
2680
2710
  if (this.scaleX == val)
2681
2711
  return;
@@ -2779,7 +2809,6 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
2779
2809
  */
2780
2810
  function DisplayObjectContainer() {
2781
2811
  var _this = _super.call(this) || this;
2782
- _this._mouseChildren = true;
2783
2812
  _this._children = new Array();
2784
2813
  _this.doingSwap = false;
2785
2814
  _this.tabChildren = false;
@@ -2795,40 +2824,6 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
2795
2824
  enumerable: true,
2796
2825
  configurable: true
2797
2826
  });
2798
- Object.defineProperty(DisplayObjectContainer.prototype, "mouseChildren", {
2799
- /**
2800
- * Determines whether or not the children of the object are mouse, or user
2801
- * input device, enabled. If an object is enabled, a user can interact with
2802
- * it by using a mouse or user input device. The default is
2803
- * <code>true</code>.
2804
- *
2805
- * <p>This property is useful when you create a button with an instance of
2806
- * the Sprite class(instead of using the SimpleButton class). When you use a
2807
- * Sprite instance to create a button, you can choose to decorate the button
2808
- * by using the <code>addChild()</code> method to add additional Sprite
2809
- * instances. This process can cause unexpected behavior with mouse events
2810
- * because the Sprite instances you add as children can become the target
2811
- * object of a mouse event when you expect the parent instance to be the
2812
- * target object. To ensure that the parent instance serves as the target
2813
- * objects for mouse events, you can set the <code>mouseChildren</code>
2814
- * property of the parent instance to <code>false</code>.</p>
2815
- *
2816
- * <p> No event is dispatched by setting this property. You must use the
2817
- * <code>addEventListener()</code> method to create interactive
2818
- * functionality.</p>
2819
- */
2820
- get: function () {
2821
- return this._mouseChildren;
2822
- },
2823
- set: function (value) {
2824
- if (this._mouseChildren == value)
2825
- return;
2826
- this._mouseChildren = value;
2827
- this._invalidateHierarchicalProperty(_awayjs_view.HierarchicalProperty.MOUSE_ENABLED);
2828
- },
2829
- enumerable: true,
2830
- configurable: true
2831
- });
2832
2827
  Object.defineProperty(DisplayObjectContainer.prototype, "animator", {
2833
2828
  /**
2834
2829
  * Defines the animator of the display object. Default value is <code>null</code>.
@@ -2949,7 +2944,6 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
2949
2944
  };
2950
2945
  DisplayObjectContainer.prototype.copyTo = function (newInstance) {
2951
2946
  _super.prototype.copyTo.call(this, newInstance);
2952
- newInstance.mouseChildren = this._mouseChildren;
2953
2947
  if (this._animator)
2954
2948
  newInstance.animator = this._animator.clone();
2955
2949
  var len = this._children.length;
@@ -3230,6 +3224,10 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
3230
3224
  }
3231
3225
  }
3232
3226
  };
3227
+ DisplayObjectContainer.prototype._initNode = function (node) {
3228
+ for (var i = 0; i < this._children.length; ++i)
3229
+ node.addChildAt(this._children[i], i);
3230
+ };
3233
3231
  /**
3234
3232
  * @private
3235
3233
  *
@@ -3268,9 +3266,7 @@ var Sprite = /** @class */ (function (_super) {
3268
3266
  if (graphics === void 0) { graphics = null; }
3269
3267
  if (material === void 0) { material = null; }
3270
3268
  var _this = _super.call(this) || this;
3271
- _this._isEntity = false;
3272
- _this._onGraphicsInvalidateDelegate = function (event) { return _this._onGraphicsInvalidate(event); };
3273
- _this.graphics = graphics || _awayjs_graphics.Graphics.getGraphics();
3269
+ _this.graphics = graphics;
3274
3270
  _this.material = material;
3275
3271
  return _this;
3276
3272
  // this.dropBitmapCache = this.dropBitmapCache.bind(this);
@@ -3281,7 +3277,7 @@ var Sprite = /** @class */ (function (_super) {
3281
3277
  if (material === void 0) { material = null; }
3282
3278
  if (Sprite._sprites.length) {
3283
3279
  var sprite = Sprite._sprites.pop();
3284
- sprite.graphics = graphics || _awayjs_graphics.Graphics.getGraphics();
3280
+ sprite.graphics = graphics;
3285
3281
  sprite.material = material;
3286
3282
  return sprite;
3287
3283
  }
@@ -3306,45 +3302,31 @@ var Sprite = /** @class */ (function (_super) {
3306
3302
  * drawing commands can occur.
3307
3303
  */
3308
3304
  get: function () {
3309
- if (this._iSourcePrefab)
3310
- this._iSourcePrefab._iValidate();
3305
+ //create new graphics object if none exists
3306
+ if (!this._graphics) {
3307
+ this.graphics = _awayjs_graphics.Graphics.getGraphics();
3308
+ this.invalidate();
3309
+ }
3311
3310
  return this._graphics;
3312
3311
  },
3313
3312
  set: function (value) {
3314
- if (value == null)
3315
- throw new Error('Cannot have graphics set to null');
3316
- this._setGraphics(value);
3313
+ if (this._graphics == value)
3314
+ return;
3315
+ if (this._graphics) {
3316
+ this._graphics.usages--;
3317
+ //if (!this._graphics.usages)
3318
+ // this.graphics.dispose();
3319
+ }
3320
+ this._graphics = value;
3321
+ if (this._graphics)
3322
+ this._graphics.usages++;
3323
+ this.invalidate();
3317
3324
  },
3318
3325
  enumerable: true,
3319
3326
  configurable: true
3320
3327
  });
3321
- Sprite.prototype._setGraphics = function (value) {
3322
- if (this._graphics == value) {
3323
- return;
3324
- }
3325
- if (this._graphics) {
3326
- this._graphics.removeEventListener(_awayjs_core.AssetEvent.INVALIDATE, this._onGraphicsInvalidateDelegate);
3327
- this._graphics.usages--;
3328
- //if (!this._graphics.usages)
3329
- // this.graphics.dispose();
3330
- }
3331
- this._graphics = value;
3332
- this._graphics.usages++;
3333
- this._onGraphicsInvalidate(null);
3334
- };
3335
- Sprite.prototype._setParent = function (parent) {
3336
- _super.prototype._setParent.call(this, parent);
3337
- if (parent)
3338
- this._graphics.addEventListener(_awayjs_core.AssetEvent.INVALIDATE, this._onGraphicsInvalidateDelegate);
3339
- else
3340
- this._graphics.removeEventListener(_awayjs_core.AssetEvent.INVALIDATE, this._onGraphicsInvalidateDelegate);
3341
- // if (this._requestCacheAsBitmap) {
3342
- // this.set_cacheAsBitmapInternal(true);
3343
- // console.log('Restore cache');
3344
- // }
3345
- };
3346
- Sprite.prototype.isEntity = function () {
3347
- return (this._graphics && this._graphics.count > 0);
3328
+ Sprite.prototype.getEntity = function () {
3329
+ return this._graphics;
3348
3330
  };
3349
3331
  /**
3350
3332
  * @inheritDoc
@@ -3384,39 +3366,16 @@ var Sprite = /** @class */ (function (_super) {
3384
3366
  if (cloneShapes === void 0) { cloneShapes = false; }
3385
3367
  _super.prototype.copyTo.call(this, sprite);
3386
3368
  sprite._iSourcePrefab = this._iSourcePrefab;
3387
- this._graphics.copyTo(sprite._graphics, cloneShapes);
3369
+ if (this._graphics)
3370
+ this._graphics.copyTo(sprite.graphics, cloneShapes);
3388
3371
  };
3389
3372
  /**
3390
3373
  *
3391
3374
  */
3392
3375
  Sprite.prototype._iInternalUpdate = function () {
3393
3376
  _super.prototype._iInternalUpdate.call(this);
3394
- // if(this.parent)
3395
- // this._graphics.updateScale(view);
3396
- };
3397
- /**
3398
- * //TODO
3399
- *
3400
- * @private
3401
- */
3402
- Sprite.prototype._onGraphicsInvalidate = function (_event) {
3403
- var isEntity = this.isEntity();
3404
- if (this._isEntity != isEntity) {
3405
- if (!isEntity)
3406
- this._clearEntity();
3407
- this._isEntity = isEntity;
3408
- }
3409
- this.invalidate();
3410
- };
3411
- /**
3412
- *
3413
- * @param renderer
3414
- *
3415
- * @internal
3416
- */
3417
- Sprite.prototype._acceptTraverser = function (traverser) {
3418
- _super.prototype._acceptTraverser.call(this, traverser);
3419
- this.graphics._acceptTraverser(traverser);
3377
+ if (this._iSourcePrefab)
3378
+ this._iSourcePrefab._iValidate();
3420
3379
  };
3421
3380
  /**
3422
3381
  *
@@ -3428,8 +3387,7 @@ var Sprite = /** @class */ (function (_super) {
3428
3387
  Sprite._sprites = new Array();
3429
3388
  Sprite.assetType = '[asset Sprite]';
3430
3389
  return Sprite;
3431
- }(DisplayObjectContainer));
3432
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, Sprite);
3390
+ }(DisplayObjectContainer));
3433
3391
 
3434
3392
  var ONCE_EMIT_MORPH_ERROR = Object.create(null);
3435
3393
  function once(obj, error) {
@@ -3459,22 +3417,6 @@ var MorphSprite = /** @class */ (function (_super) {
3459
3417
  }
3460
3418
  return new MorphSprite(graphics, material);
3461
3419
  };
3462
- MorphSprite.prototype._setGraphics = function (value) {
3463
- if (this._graphics == value) {
3464
- return;
3465
- }
3466
- if (this._graphics) {
3467
- this._graphics.removeEventListener(_awayjs_core.AssetEvent.INVALIDATE, this._onGraphicsInvalidateDelegate);
3468
- this._graphics.usages--;
3469
- //if (!this._graphics.usages)
3470
- // this.graphics.dispose();
3471
- }
3472
- if (!this._graphics) {
3473
- this._graphics = _awayjs_graphics.Graphics.getGraphics();
3474
- }
3475
- this._graphics.copyFrom(value);
3476
- this._onGraphicsInvalidate(null);
3477
- };
3478
3420
  Object.defineProperty(MorphSprite.prototype, "assetType", {
3479
3421
  get: function () {
3480
3422
  return MorphSprite.assetType;
@@ -3695,8 +3637,7 @@ var MorphSprite = /** @class */ (function (_super) {
3695
3637
  MorphSprite.assetType = '[asset MorphSprite]';
3696
3638
  MorphSprite._morphSprites = new Array();
3697
3639
  return MorphSprite;
3698
- }(Sprite));
3699
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, MorphSprite);
3640
+ }(Sprite));
3700
3641
 
3701
3642
  var _a;
3702
3643
  var BLEND_MODES = [
@@ -5123,8 +5064,8 @@ var Billboard = /** @class */ (function (_super) {
5123
5064
  Billboard.prototype.advanceFrame = function () {
5124
5065
  //override for billboard
5125
5066
  };
5126
- Billboard.prototype.isEntity = function () {
5127
- return true;
5067
+ Billboard.prototype.getEntity = function () {
5068
+ return this;
5128
5069
  };
5129
5070
  /**
5130
5071
  * @inheritDoc
@@ -5408,9 +5349,6 @@ var Camera = /** @class */ (function (_super) {
5408
5349
  _this.z = -1000;
5409
5350
  return _this;
5410
5351
  }
5411
- Camera.prototype.isEntity = function () {
5412
- return true;
5413
- };
5414
5352
  Object.defineProperty(Camera.prototype, "assetType", {
5415
5353
  //@override
5416
5354
  get: function () {
@@ -5564,8 +5502,8 @@ var LineSegment = /** @class */ (function (_super) {
5564
5502
  enumerable: true,
5565
5503
  configurable: true
5566
5504
  });
5567
- LineSegment.prototype.isEntity = function () {
5568
- return true;
5505
+ LineSegment.prototype.getEntity = function () {
5506
+ return this;
5569
5507
  };
5570
5508
  LineSegment.prototype._acceptTraverser = function (traverser) {
5571
5509
  traverser.applyTraversable(this);
@@ -6728,7 +6666,7 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6728
6666
  result.screenX = this.screenX;
6729
6667
  result.screenY = this.screenY;
6730
6668
  result.view = this.view;
6731
- result.entityNode = this.entityNode;
6669
+ result.containerNode = this.containerNode;
6732
6670
  result.rootNode = this.rootNode;
6733
6671
  result.traversable = this.traversable;
6734
6672
  result.material = this.material;
@@ -6749,7 +6687,7 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6749
6687
  * The position in scene space where the event took place
6750
6688
  */
6751
6689
  get: function () {
6752
- return this.entityNode.parent.getMatrix3D().transformVector(this.position);
6690
+ return this.containerNode.getMatrix3D().transformVector(this.position);
6753
6691
  },
6754
6692
  enumerable: true,
6755
6693
  configurable: true
@@ -6759,7 +6697,7 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6759
6697
  * The normal in scene space where the event took place
6760
6698
  */
6761
6699
  get: function () {
6762
- var sceneNormal = this.entityNode.parent.getMatrix3D().deltaTransformVector(this.normal);
6700
+ var sceneNormal = this.containerNode.getMatrix3D().deltaTransformVector(this.normal);
6763
6701
  sceneNormal.normalize();
6764
6702
  return sceneNormal;
6765
6703
  },
@@ -6946,7 +6884,6 @@ var MovieClip = /** @class */ (function (_super) {
6946
6884
  if (MovieClip._movieClips.length) {
6947
6885
  var movieClip = MovieClip._movieClips.pop();
6948
6886
  movieClip.timeline = timeline;
6949
- movieClip.graphics = _awayjs_graphics.Graphics.getGraphics();
6950
6887
  return movieClip;
6951
6888
  }
6952
6889
  return new MovieClip(timeline);
@@ -7326,7 +7263,8 @@ var MovieClip = /** @class */ (function (_super) {
7326
7263
  this.constructedKeyFrameIndex = -1;
7327
7264
  for (var i = this.numChildren - 1; i >= 0; i--)
7328
7265
  this.removeChildAt(i);
7329
- this.graphics.clear();
7266
+ if (this._graphics)
7267
+ this._graphics.clear();
7330
7268
  if (fireScripts) {
7331
7269
  var numFrames = this._timeline.keyframe_indices.length;
7332
7270
  this._isPlaying = Boolean(numFrames > 1);
@@ -8056,8 +7994,8 @@ var Skybox = /** @class */ (function (_super) {
8056
7994
  Skybox.prototype.getTextureAt = function (index) {
8057
7995
  return this._textures[index];
8058
7996
  };
8059
- Skybox.prototype.isEntity = function () {
8060
- return true;
7997
+ Skybox.prototype.getEntity = function () {
7998
+ return this;
8061
7999
  };
8062
8000
  Object.defineProperty(Skybox.prototype, "assetType", {
8063
8001
  get: function () {
@@ -10632,14 +10570,14 @@ var TextSprite = /** @class */ (function (_super) {
10632
10570
  function TextSprite() {
10633
10571
  return _super !== null && _super.apply(this, arguments) || this;
10634
10572
  }
10635
- TextSprite.prototype._acceptTraverser = function (traverser) {
10573
+ TextSprite.prototype._iInternalUpdate = function () {
10574
+ _super.prototype._iInternalUpdate.call(this);
10636
10575
  var tf = this.parentTextField;
10637
10576
  //tf.reConstruct(true);
10638
10577
  if (tf._textFormat && !tf._textFormat.font_table.isAsset(TesselatedFontTable) && !tf._textFormat.material) {
10639
10578
  this.transform.colorTransform.color = (tf.textColor != null) ? tf.textColor : tf._textFormat.color;
10640
10579
  this._invalidateHierarchicalProperty(_awayjs_view.HierarchicalProperty.COLOR_TRANSFORM);
10641
10580
  }
10642
- this._graphics._acceptTraverser(traverser);
10643
10581
  };
10644
10582
  return TextSprite;
10645
10583
  }(Sprite));
@@ -11289,7 +11227,6 @@ var TextField = /** @class */ (function (_super) {
11289
11227
  */
11290
11228
  function TextField() {
11291
11229
  var _this = _super.call(this) || this;
11292
- _this._isEntity = false;
11293
11230
  _this.textOffsetX = 0;
11294
11231
  _this.textOffsetY = 0;
11295
11232
  _this._selectionBeginIndex = 0;
@@ -11354,7 +11291,6 @@ var TextField = /** @class */ (function (_super) {
11354
11291
  _this.startSelectionByMouseDelegate = function (event) { return _this.startSelectionByMouse(event); };
11355
11292
  _this.stopSelectionByMouseDelegate = function (event) { return _this.stopSelectionByMouse(event); };
11356
11293
  _this.updateSelectionByMouseDelegate = function (event) { return _this.updateSelectionByMouse(event); };
11357
- _this._onGraphicsInvalidateDelegate = function (event) { return _this._onGraphicsInvalidate(event); };
11358
11294
  _this._onClipboardPasteDelegate = function (event) { return _this.onClipboardPaste(event); };
11359
11295
  _this.cursorIntervalID = -1;
11360
11296
  _this._tabEnabled = true;
@@ -11385,7 +11321,6 @@ var TextField = /** @class */ (function (_super) {
11385
11321
  _this._scrollV = 0;
11386
11322
  _this._textFormats = [];
11387
11323
  _this._graphics = _awayjs_graphics.Graphics.getGraphics(); //unique graphics object for each TextField
11388
- _this._graphics.addEventListener(_awayjs_core.AssetEvent.INVALIDATE, _this._onGraphicsInvalidateDelegate);
11389
11324
  _this.mouseEnabled = _this._selectable;
11390
11325
  return _this;
11391
11326
  }
@@ -11477,7 +11412,7 @@ var TextField = /** @class */ (function (_super) {
11477
11412
  // }
11478
11413
  this.setSelection(0, 0);
11479
11414
  this._glyphsDirty = true;
11480
- this._invalidateEntity();
11415
+ this.invalidate();
11481
11416
  };
11482
11417
  TextField.prototype.enableInput = function (enable) {
11483
11418
  if (enable === void 0) { enable = true; }
@@ -11843,20 +11778,6 @@ var TextField = /** @class */ (function (_super) {
11843
11778
  // this._internalScale=scale;
11844
11779
  // this._glyphsDirty=true;
11845
11780
  };
11846
- /**
11847
- * //TODO
11848
- *
11849
- * @private
11850
- */
11851
- TextField.prototype._onGraphicsInvalidate = function (event) {
11852
- var isEntity = this.isEntity();
11853
- if (this._isEntity != isEntity) {
11854
- if (!isEntity)
11855
- this._clearEntity();
11856
- this._isEntity = isEntity;
11857
- }
11858
- this.invalidate();
11859
- };
11860
11781
  Object.defineProperty(TextField.prototype, "assetType", {
11861
11782
  /**
11862
11783
  *
@@ -11994,11 +11915,8 @@ var TextField = /** @class */ (function (_super) {
11994
11915
  this._iTextWoLineBreaks = processedText.replace(/(\r\n|\n|\\n|\r)/gm, '');
11995
11916
  this._textDirty = true;
11996
11917
  //console.log("set text", value, "on" , this);
11997
- if (this._autoSize != TextFieldAutoSize.NONE)
11998
- this.invalidate();
11999
- else
12000
- this._invalidateEntity();
12001
11918
  this.newTextFormat = this._textFormats[this._textFormats.length - 1];
11919
+ this.invalidate();
12002
11920
  },
12003
11921
  enumerable: true,
12004
11922
  configurable: true
@@ -12228,10 +12146,7 @@ var TextField = /** @class */ (function (_super) {
12228
12146
  this._textFormatsIdx = [this._iText.length];
12229
12147
  this._textDirty = true;
12230
12148
  //console.log("set text", value, "on" , this);
12231
- if (this._autoSize != TextFieldAutoSize.NONE)
12232
- this.invalidate();
12233
- else
12234
- this._invalidateEntity();
12149
+ this.invalidate();
12235
12150
  },
12236
12151
  enumerable: true,
12237
12152
  configurable: true
@@ -12244,10 +12159,7 @@ var TextField = /** @class */ (function (_super) {
12244
12159
  this._textDirty = false;
12245
12160
  this._positionsDirty = false;
12246
12161
  this._glyphsDirty = true;
12247
- if (this._autoSize != TextFieldAutoSize.NONE)
12248
- this.invalidate();
12249
- else
12250
- this._invalidateEntity();
12162
+ this.invalidate();
12251
12163
  };
12252
12164
  Object.defineProperty(TextField.prototype, "newTextFormat", {
12253
12165
  get: function () {
@@ -12285,34 +12197,11 @@ var TextField = /** @class */ (function (_super) {
12285
12197
  // this._shapesDirty = true;
12286
12198
  this._textDirty = true;
12287
12199
  //this.reConstruct();
12288
- if (this._autoSize != TextFieldAutoSize.NONE)
12289
- this.invalidate();
12290
- else
12291
- this._invalidateEntity();
12200
+ this.invalidate();
12292
12201
  },
12293
12202
  enumerable: true,
12294
12203
  configurable: true
12295
12204
  });
12296
- /**
12297
- *
12298
- * @param renderer
12299
- *
12300
- * @internal
12301
- */
12302
- TextField.prototype._acceptTraverser = function (traverser) {
12303
- if (!this.maskMode) {
12304
- //if(!this.cursorBlinking && this._isInFocus && this.cursorShape && this._type==TextFieldType.INPUT){
12305
- // traverser[this.cursorShape.elements.traverseName](this.cursorShape);
12306
- //}
12307
- this._graphics._acceptTraverser(traverser);
12308
- //if(this.showSelection && this._isInFocus && this.bgShapeSelect){
12309
- // traverser[this.bgShapeSelect.elements.traverseName](this.bgShapeSelect);
12310
- //}
12311
- //if(this.bgShape){// && this.background){
12312
- // traverser[this.bgShape.elements.traverseName](this.bgShape);
12313
- //}
12314
- }
12315
- };
12316
12205
  Object.defineProperty(TextField.prototype, "scaleX", {
12317
12206
  /**
12318
12207
  * Indicates the horizontal scale(percentage) of the object as applied from
@@ -12390,7 +12279,7 @@ var TextField = /** @class */ (function (_super) {
12390
12279
  this._implicitPartition.invalidateEntity(this);
12391
12280
  //}*/
12392
12281
  this._glyphsDirty = true;
12393
- this._invalidateEntity();
12282
+ this.invalidate();
12394
12283
  },
12395
12284
  enumerable: true,
12396
12285
  configurable: true
@@ -12447,12 +12336,10 @@ var TextField = /** @class */ (function (_super) {
12447
12336
  return this._type;
12448
12337
  },
12449
12338
  set: function (value) {
12450
- if (this._type == value) {
12339
+ if (this._type == value)
12451
12340
  return;
12452
- }
12453
12341
  this._type = value;
12454
12342
  this._textDirty = true;
12455
- this._invalidateEntity();
12456
12343
  if (value == TextFieldType.INPUT) {
12457
12344
  //this._selectable=true;
12458
12345
  this.enableInput(true);
@@ -12462,6 +12349,7 @@ var TextField = /** @class */ (function (_super) {
12462
12349
  this.enableInput(false);
12463
12350
  this.removeEventListener(KeyboardEvent.KEYDOWN, this.onKeyDelegate);
12464
12351
  }
12352
+ this.invalidate();
12465
12353
  },
12466
12354
  enumerable: true,
12467
12355
  configurable: true
@@ -12527,8 +12415,8 @@ var TextField = /** @class */ (function (_super) {
12527
12415
  TextField.prototype.advanceFrame = function () {
12528
12416
  //override for textfield
12529
12417
  };
12530
- TextField.prototype.isEntity = function () {
12531
- return true;
12418
+ TextField.prototype.getEntity = function () {
12419
+ return this._graphics;
12532
12420
  };
12533
12421
  TextField.prototype.clear = function () {
12534
12422
  _super.prototype.clear.call(this);
@@ -13143,7 +13031,6 @@ var TextField = /** @class */ (function (_super) {
13143
13031
  }
13144
13032
  }
13145
13033
  }
13146
- this.updateMaskMode();
13147
13034
  };
13148
13035
  TextField.prototype.buildGlyphsForLabelData = function () {
13149
13036
  this._clearTextShapes();
@@ -13419,10 +13306,7 @@ var TextField = /** @class */ (function (_super) {
13419
13306
  }
13420
13307
  this._iText += newText;
13421
13308
  this._textDirty = true;
13422
- if (this._autoSize != TextFieldAutoSize.NONE)
13423
- this.invalidate();
13424
- else
13425
- this._invalidateEntity();
13309
+ this.invalidate();
13426
13310
  };
13427
13311
  /**
13428
13312
  * *tells the Textfield that a paragraph is defined completly.
@@ -13431,10 +13315,7 @@ var TextField = /** @class */ (function (_super) {
13431
13315
  TextField.prototype.closeParagraph = function () {
13432
13316
  this._iText += '\n';
13433
13317
  this._textDirty = true;
13434
- if (this._autoSize != TextFieldAutoSize.NONE)
13435
- this.invalidate();
13436
- else
13437
- this._invalidateEntity();
13318
+ this.invalidate();
13438
13319
  };
13439
13320
  /**
13440
13321
  * Returns a rectangle that is the bounding box of the character.
@@ -14274,8 +14155,7 @@ var TextField = /** @class */ (function (_super) {
14274
14155
  TextField.assetType = '[asset TextField]';
14275
14156
  TextField._onChangedEvent = new TextfieldEvent(TextfieldEvent.CHANGED);
14276
14157
  return TextField;
14277
- }(DisplayObjectContainer));
14278
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, TextField);
14158
+ }(DisplayObjectContainer));
14279
14159
 
14280
14160
  var CastError = /** @class */ (function (_super) {
14281
14161
  __extends(CastError, _super);
@@ -15362,13 +15242,13 @@ var MouseManager = /** @class */ (function () {
15362
15242
  this._stage.dispatchEvent(event);
15363
15243
  // @todo: at this point the object under the mouse might have been changed,
15364
15244
  // so we need to recheck the collision ?
15365
- var upEntityNode = null;
15245
+ var upContainerNode = null;
15366
15246
  var upRootNode = null;
15367
15247
  if (this._isAVM1Dragging && this._mouseDragCollision) {
15368
15248
  // avm1dragging is in process, dispatch the mouse-up on this.
15369
15249
  // mouseDragEntity instead of the current collision
15370
15250
  upRootNode = this._mouseDragCollision.rootNode;
15371
- upEntityNode = this._mouseDragCollision.entityNode;
15251
+ upContainerNode = this._mouseDragCollision.containerNode;
15372
15252
  }
15373
15253
  else if (this._mouseDragging && this._mouseDragCollision
15374
15254
  && this._mouseDragCollision.rootNode != dispatcher) {
@@ -15387,11 +15267,11 @@ var MouseManager = /** @class */ (function () {
15387
15267
  // but current collision is not the same as collision that appeared on mouse-down,
15388
15268
  // need to dispatch a MOUSE_UP_OUTSIDE on _mouseDragEntity
15389
15269
  upRootNode = this._mouseDragCollision.rootNode;
15390
- upEntityNode = this._mouseDragCollision.entityNode;
15270
+ upContainerNode = this._mouseDragCollision.containerNode;
15391
15271
  }
15392
15272
  if (this._mouseDragging && dispatcher)
15393
15273
  this.setupAndDispatchEvent(this._mouseOver, event, collision);
15394
- if (this._isTouch && upEntityNode)
15274
+ if (this._isTouch && upContainerNode)
15395
15275
  this.setupAndDispatchEvent(this._mouseOut, this._mouseMoveEvent, this._mouseDragCollision);
15396
15276
  if (upRootNode) {
15397
15277
  //console.log("onRelease", upRootNode)
@@ -15401,7 +15281,7 @@ var MouseManager = /** @class */ (function () {
15401
15281
  this.dispatchEvent(event, dispatcher);
15402
15282
  else if (this._eventBubbling)
15403
15283
  this._stage.dispatchEvent(event);
15404
- if (upEntityNode)
15284
+ if (upContainerNode)
15405
15285
  this.setupAndDispatchEvent(this._dragStop, event, this._mouseDragCollision);
15406
15286
  this._mouseDragCollision = null;
15407
15287
  this._mouseDragging = false;
@@ -15679,7 +15559,7 @@ var MouseManager = /** @class */ (function () {
15679
15559
  //console.log("event", event, collisionNode, collisionNode);
15680
15560
  // 3D properties.
15681
15561
  if (collision) {
15682
- event.entityNode = collision.entityNode;
15562
+ event.containerNode = collision.containerNode;
15683
15563
  event.rootNode = collision.rootNode;
15684
15564
  // Object.
15685
15565
  event.traversable = collision.traversable;
@@ -15694,7 +15574,7 @@ var MouseManager = /** @class */ (function () {
15694
15574
  }
15695
15575
  else {
15696
15576
  // Set all to null.
15697
- event.entityNode = null;
15577
+ event.containerNode = null;
15698
15578
  event.rootNode = null;
15699
15579
  event.traversable = null;
15700
15580
  event.uv = null;
@@ -18317,7 +18197,7 @@ var Scene = /** @class */ (function () {
18317
18197
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18318
18198
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18319
18199
 
18320
- console.debug('AwayJS - Scene - 0.13.246');
18200
+ console.debug('AwayJS - Scene - 0.13.248');
18321
18201
 
18322
18202
  exports.Timeline = Timeline;
18323
18203
  exports.ControllerBase = ControllerBase;