@awayjs/scene 0.13.247 → 0.13.249

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 (45) hide show
  1. package/bundle/awayjs-scene.umd.js +70 -196
  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.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/lib/base/MouseButtons.d.ts +23 -0
  9. package/dist/lib/base/MouseButtons.d.ts.map +1 -0
  10. package/dist/lib/base/MouseButtons.js +0 -0
  11. package/dist/lib/display/DisplayObject.d.ts +1 -3
  12. package/dist/lib/display/DisplayObject.d.ts.map +1 -1
  13. package/dist/lib/display/DisplayObject.js +1 -5
  14. package/dist/lib/display/MorphSprite.d.ts +0 -1
  15. package/dist/lib/display/MorphSprite.d.ts.map +1 -1
  16. package/dist/lib/display/MorphSprite.js +1 -17
  17. package/dist/lib/display/MovieClip.d.ts +1 -2
  18. package/dist/lib/display/MovieClip.d.ts.map +1 -1
  19. package/dist/lib/display/MovieClip.js +9 -18
  20. package/dist/lib/display/Sprite.d.ts +1 -18
  21. package/dist/lib/display/Sprite.d.ts.map +1 -1
  22. package/dist/lib/display/Sprite.js +23 -57
  23. package/dist/lib/display/TextField.d.ts +1 -15
  24. package/dist/lib/display/TextField.d.ts.map +1 -1
  25. package/dist/lib/display/TextField.js +12 -64
  26. package/dist/lib/display/TextSprite.d.ts +1 -2
  27. package/dist/lib/display/TextSprite.d.ts.map +1 -1
  28. package/dist/lib/display/TextSprite.js +2 -2
  29. package/dist/lib/events/MouseEvent.d.ts +3 -2
  30. package/dist/lib/events/MouseEvent.d.ts.map +1 -1
  31. package/dist/lib/events/MouseEvent.js +4 -4
  32. package/dist/lib/managers/MouseManager.d.ts +0 -1
  33. package/dist/lib/managers/MouseManager.d.ts.map +1 -1
  34. package/dist/lib/managers/MouseManager.js +17 -33
  35. package/index.ts +2 -1
  36. package/lib/base/MouseButtons.ts +27 -0
  37. package/lib/display/DisplayObject.ts +0 -9
  38. package/lib/display/MorphSprite.ts +1 -22
  39. package/lib/display/MovieClip.ts +11 -20
  40. package/lib/display/Sprite.ts +16 -59
  41. package/lib/display/TextField.ts +17 -72
  42. package/lib/display/TextSprite.ts +3 -4
  43. package/lib/events/MouseEvent.ts +6 -5
  44. package/lib/managers/MouseManager.ts +18 -36
  45. package/package.json +1 -1
@@ -2689,9 +2689,6 @@ var DisplayObject = /** @class */ (function (_super) {
2689
2689
  DisplayObject.prototype._invalidateHierarchicalProperty = function (propDirty) {
2690
2690
  this.dispatchEvent(new _awayjs_view.HeirarchicalEvent(_awayjs_view.HeirarchicalEvent.INVALIDATE_PROPERTY, propDirty));
2691
2691
  };
2692
- DisplayObject.prototype._updateEntity = function () {
2693
- this.dispatchEvent(new _awayjs_view.ContainerEvent(_awayjs_view.ContainerEvent.UPDATE_ENTITY, this));
2694
- };
2695
2692
  /**
2696
2693
  *
2697
2694
  */
@@ -2709,7 +2706,6 @@ var DisplayObject = /** @class */ (function (_super) {
2709
2706
  enumerable: true,
2710
2707
  configurable: true
2711
2708
  });
2712
- DisplayObject.prototype._acceptTraverser = function (_traverser) { };
2713
2709
  DisplayObject.prototype._setScaleX = function (val) {
2714
2710
  if (this.scaleX == val)
2715
2711
  return;
@@ -3270,8 +3266,7 @@ var Sprite = /** @class */ (function (_super) {
3270
3266
  if (graphics === void 0) { graphics = null; }
3271
3267
  if (material === void 0) { material = null; }
3272
3268
  var _this = _super.call(this) || this;
3273
- _this._onGraphicsInvalidateDelegate = function (event) { return _this._onGraphicsInvalidate(event); };
3274
- _this.graphics = graphics || _awayjs_graphics.Graphics.getGraphics();
3269
+ _this.graphics = graphics;
3275
3270
  _this.material = material;
3276
3271
  return _this;
3277
3272
  // this.dropBitmapCache = this.dropBitmapCache.bind(this);
@@ -3282,7 +3277,7 @@ var Sprite = /** @class */ (function (_super) {
3282
3277
  if (material === void 0) { material = null; }
3283
3278
  if (Sprite._sprites.length) {
3284
3279
  var sprite = Sprite._sprites.pop();
3285
- sprite.graphics = graphics || _awayjs_graphics.Graphics.getGraphics();
3280
+ sprite.graphics = graphics;
3286
3281
  sprite.material = material;
3287
3282
  return sprite;
3288
3283
  }
@@ -3307,44 +3302,31 @@ var Sprite = /** @class */ (function (_super) {
3307
3302
  * drawing commands can occur.
3308
3303
  */
3309
3304
  get: function () {
3310
- if (this._iSourcePrefab)
3311
- 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
+ }
3312
3310
  return this._graphics;
3313
3311
  },
3314
3312
  set: function (value) {
3315
- if (value == null)
3316
- throw new Error('Cannot have graphics set to null');
3317
- 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();
3318
3324
  },
3319
3325
  enumerable: true,
3320
3326
  configurable: true
3321
3327
  });
3322
- Sprite.prototype._setGraphics = function (value) {
3323
- if (this._graphics == value)
3324
- return;
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.invalidate();
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
3328
  Sprite.prototype.getEntity = function () {
3347
- return (this._graphics.count > 0) ? this : null;
3329
+ return this._graphics;
3348
3330
  };
3349
3331
  /**
3350
3332
  * @inheritDoc
@@ -3384,33 +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
- this.invalidate();
3404
- };
3405
- /**
3406
- *
3407
- * @param renderer
3408
- *
3409
- * @internal
3410
- */
3411
- Sprite.prototype._acceptTraverser = function (traverser) {
3412
- _super.prototype._acceptTraverser.call(this, traverser);
3413
- this.graphics._acceptTraverser(traverser);
3377
+ if (this._iSourcePrefab)
3378
+ this._iSourcePrefab._iValidate();
3414
3379
  };
3415
3380
  /**
3416
3381
  *
@@ -3422,8 +3387,7 @@ var Sprite = /** @class */ (function (_super) {
3422
3387
  Sprite._sprites = new Array();
3423
3388
  Sprite.assetType = '[asset Sprite]';
3424
3389
  return Sprite;
3425
- }(DisplayObjectContainer));
3426
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, Sprite);
3390
+ }(DisplayObjectContainer));
3427
3391
 
3428
3392
  var ONCE_EMIT_MORPH_ERROR = Object.create(null);
3429
3393
  function once(obj, error) {
@@ -3453,20 +3417,6 @@ var MorphSprite = /** @class */ (function (_super) {
3453
3417
  }
3454
3418
  return new MorphSprite(graphics, material);
3455
3419
  };
3456
- MorphSprite.prototype._setGraphics = function (value) {
3457
- if (this._graphics == value) {
3458
- return;
3459
- }
3460
- if (this._graphics) {
3461
- this._graphics.removeEventListener(_awayjs_core.AssetEvent.INVALIDATE, this._onGraphicsInvalidateDelegate);
3462
- this._graphics.usages--;
3463
- //if (!this._graphics.usages)
3464
- // this.graphics.dispose();
3465
- }
3466
- if (!this._graphics)
3467
- this._graphics = _awayjs_graphics.Graphics.getGraphics();
3468
- this._graphics.copyFrom(value);
3469
- };
3470
3420
  Object.defineProperty(MorphSprite.prototype, "assetType", {
3471
3421
  get: function () {
3472
3422
  return MorphSprite.assetType;
@@ -3687,8 +3637,7 @@ var MorphSprite = /** @class */ (function (_super) {
3687
3637
  MorphSprite.assetType = '[asset MorphSprite]';
3688
3638
  MorphSprite._morphSprites = new Array();
3689
3639
  return MorphSprite;
3690
- }(Sprite));
3691
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, MorphSprite);
3640
+ }(Sprite));
3692
3641
 
3693
3642
  var _a;
3694
3643
  var BLEND_MODES = [
@@ -6669,9 +6618,9 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6669
6618
  function MouseEvent(type) {
6670
6619
  var _this = _super.call(this, type) || this;
6671
6620
  /**
6672
- * Current button that fire event
6621
+ * Current buttons status
6673
6622
  */
6674
- _this.button = 0;
6623
+ _this.buttons = 0;
6675
6624
  return _this;
6676
6625
  }
6677
6626
  Object.defineProperty(MouseEvent.prototype, "bubbles", {
@@ -6730,7 +6679,7 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6730
6679
  result.shiftKey = this.shiftKey;
6731
6680
  result._iParentEvent = this;
6732
6681
  result._iAllowedToPropagate = this._iAllowedToPropagate;
6733
- result.button = this.button;
6682
+ result.buttons = this.buttons;
6734
6683
  return result;
6735
6684
  };
6736
6685
  Object.defineProperty(MouseEvent.prototype, "scenePosition", {
@@ -6756,7 +6705,7 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6756
6705
  configurable: true
6757
6706
  });
6758
6707
  MouseEvent.prototype._dispatchEvent = function (dispatcher, target) {
6759
- if (!dispatcher.isMouseDisabled()) {
6708
+ if (!dispatcher.isMouseDisabled() || this.type == MouseEvent.MOUSE_OUT || this.type == MouseEvent.ROLL_OUT) {
6760
6709
  dispatcher.container.dispatchEvent(this, target);
6761
6710
  FrameScriptManager.execute_queue();
6762
6711
  }
@@ -6896,12 +6845,12 @@ var MovieClip = /** @class */ (function (_super) {
6896
6845
  //this.debugVisible=true;
6897
6846
  _this._onMouseOver = function (_event) {
6898
6847
  if (_this.buttonEnabled)
6899
- _this.currentFrameIndex = 1;
6848
+ _this.currentFrameIndex = (_event.buttons & 1 /* PRIMARY_BUTTON */) ? _this.currentFrameIndex == 0 ? 0 : 2 : 1;
6900
6849
  else
6901
6850
  _this.currentFrameIndex = 0;
6902
6851
  };
6903
6852
  _this._onMouseOut = function (_event) {
6904
- _this.currentFrameIndex = 0;
6853
+ _this.currentFrameIndex = (_event.buttons & 1 /* PRIMARY_BUTTON */ && _this.currentFrameIndex != 0) ? 1 : 0;
6905
6854
  };
6906
6855
  _this._onMouseDown = function (_event) {
6907
6856
  if (_this.buttonEnabled)
@@ -6910,17 +6859,11 @@ var MovieClip = /** @class */ (function (_super) {
6910
6859
  _this.currentFrameIndex = 0;
6911
6860
  };
6912
6861
  _this._onMouseUp = function (_event) {
6913
- _this.currentFrameIndex = _this.currentFrameIndex == 0 ? 0 : 1;
6914
- };
6915
- _this._onDragOver = function (_event) {
6916
- if (_this.buttonEnabled)
6917
- _this.currentFrameIndex = 2;
6918
- else
6919
- _this.currentFrameIndex = 0;
6920
- };
6921
- _this._onDragOut = function (_event) {
6922
6862
  _this.currentFrameIndex = 1;
6923
6863
  };
6864
+ _this._onMouseUpOutside = function (_event) {
6865
+ _this.currentFrameIndex = 0;
6866
+ };
6924
6867
  _this._timeline = timeline;
6925
6868
  if (spriteMode) {
6926
6869
  _this.transformToSprite();
@@ -6935,7 +6878,6 @@ var MovieClip = /** @class */ (function (_super) {
6935
6878
  if (MovieClip._movieClips.length) {
6936
6879
  var movieClip = MovieClip._movieClips.pop();
6937
6880
  movieClip.timeline = timeline;
6938
- movieClip.graphics = _awayjs_graphics.Graphics.getGraphics();
6939
6881
  return movieClip;
6940
6882
  }
6941
6883
  return new MovieClip(timeline);
@@ -7315,7 +7257,8 @@ var MovieClip = /** @class */ (function (_super) {
7315
7257
  this.constructedKeyFrameIndex = -1;
7316
7258
  for (var i = this.numChildren - 1; i >= 0; i--)
7317
7259
  this.removeChildAt(i);
7318
- this.graphics.clear();
7260
+ if (this._graphics)
7261
+ this._graphics.clear();
7319
7262
  if (fireScripts) {
7320
7263
  var numFrames = this._timeline.keyframe_indices.length;
7321
7264
  this._isPlaying = Boolean(numFrames > 1);
@@ -7414,8 +7357,7 @@ var MovieClip = /** @class */ (function (_super) {
7414
7357
  this.addEventListener(MouseEvent$1.MOUSE_OUT, this._onMouseOut);
7415
7358
  this.addEventListener(MouseEvent$1.MOUSE_DOWN, this._onMouseDown);
7416
7359
  this.addEventListener(MouseEvent$1.MOUSE_UP, this._onMouseUp);
7417
- this.addEventListener(MouseEvent$1.DRAG_OVER, this._onDragOver);
7418
- this.addEventListener(MouseEvent$1.DRAG_OUT, this._onDragOut);
7360
+ this.addEventListener(MouseEvent$1.MOUSE_UP_OUTSIDE, this._onMouseUpOutside);
7419
7361
  this.mouseChildren = false;
7420
7362
  };
7421
7363
  MovieClip.prototype.removeButtonListeners = function () {
@@ -7423,8 +7365,7 @@ var MovieClip = /** @class */ (function (_super) {
7423
7365
  this.removeEventListener(MouseEvent$1.MOUSE_OUT, this._onMouseOut);
7424
7366
  this.removeEventListener(MouseEvent$1.MOUSE_DOWN, this._onMouseDown);
7425
7367
  this.removeEventListener(MouseEvent$1.MOUSE_UP, this._onMouseUp);
7426
- this.removeEventListener(MouseEvent$1.DRAG_OVER, this._onDragOver);
7427
- this.removeEventListener(MouseEvent$1.DRAG_OUT, this._onDragOut);
7368
+ this.removeEventListener(MouseEvent$1.MOUSE_UP_OUTSIDE, this._onMouseUpOutside);
7428
7369
  };
7429
7370
  MovieClip.prototype.getTimelineChildAtSessionID = function (sessionID) {
7430
7371
  return this._sessionID_childs[sessionID];
@@ -10621,14 +10562,14 @@ var TextSprite = /** @class */ (function (_super) {
10621
10562
  function TextSprite() {
10622
10563
  return _super !== null && _super.apply(this, arguments) || this;
10623
10564
  }
10624
- TextSprite.prototype._acceptTraverser = function (traverser) {
10565
+ TextSprite.prototype._iInternalUpdate = function () {
10566
+ _super.prototype._iInternalUpdate.call(this);
10625
10567
  var tf = this.parentTextField;
10626
10568
  //tf.reConstruct(true);
10627
10569
  if (tf._textFormat && !tf._textFormat.font_table.isAsset(TesselatedFontTable) && !tf._textFormat.material) {
10628
10570
  this.transform.colorTransform.color = (tf.textColor != null) ? tf.textColor : tf._textFormat.color;
10629
10571
  this._invalidateHierarchicalProperty(_awayjs_view.HierarchicalProperty.COLOR_TRANSFORM);
10630
10572
  }
10631
- this._graphics._acceptTraverser(traverser);
10632
10573
  };
10633
10574
  return TextSprite;
10634
10575
  }(Sprite));
@@ -11342,7 +11283,6 @@ var TextField = /** @class */ (function (_super) {
11342
11283
  _this.startSelectionByMouseDelegate = function (event) { return _this.startSelectionByMouse(event); };
11343
11284
  _this.stopSelectionByMouseDelegate = function (event) { return _this.stopSelectionByMouse(event); };
11344
11285
  _this.updateSelectionByMouseDelegate = function (event) { return _this.updateSelectionByMouse(event); };
11345
- _this._onGraphicsInvalidateDelegate = function (event) { return _this._onGraphicsInvalidate(event); };
11346
11286
  _this._onClipboardPasteDelegate = function (event) { return _this.onClipboardPaste(event); };
11347
11287
  _this.cursorIntervalID = -1;
11348
11288
  _this._tabEnabled = true;
@@ -11373,7 +11313,6 @@ var TextField = /** @class */ (function (_super) {
11373
11313
  _this._scrollV = 0;
11374
11314
  _this._textFormats = [];
11375
11315
  _this._graphics = _awayjs_graphics.Graphics.getGraphics(); //unique graphics object for each TextField
11376
- _this._graphics.addEventListener(_awayjs_core.AssetEvent.INVALIDATE, _this._onGraphicsInvalidateDelegate);
11377
11316
  _this.mouseEnabled = _this._selectable;
11378
11317
  return _this;
11379
11318
  }
@@ -11465,7 +11404,7 @@ var TextField = /** @class */ (function (_super) {
11465
11404
  // }
11466
11405
  this.setSelection(0, 0);
11467
11406
  this._glyphsDirty = true;
11468
- this._updateEntity();
11407
+ this.invalidate();
11469
11408
  };
11470
11409
  TextField.prototype.enableInput = function (enable) {
11471
11410
  if (enable === void 0) { enable = true; }
@@ -11831,14 +11770,6 @@ var TextField = /** @class */ (function (_super) {
11831
11770
  // this._internalScale=scale;
11832
11771
  // this._glyphsDirty=true;
11833
11772
  };
11834
- /**
11835
- * //TODO
11836
- *
11837
- * @private
11838
- */
11839
- TextField.prototype._onGraphicsInvalidate = function (event) {
11840
- this.invalidate();
11841
- };
11842
11773
  Object.defineProperty(TextField.prototype, "assetType", {
11843
11774
  /**
11844
11775
  *
@@ -11976,11 +11907,8 @@ var TextField = /** @class */ (function (_super) {
11976
11907
  this._iTextWoLineBreaks = processedText.replace(/(\r\n|\n|\\n|\r)/gm, '');
11977
11908
  this._textDirty = true;
11978
11909
  //console.log("set text", value, "on" , this);
11979
- if (this._autoSize != TextFieldAutoSize.NONE)
11980
- this.invalidate();
11981
- else
11982
- this._updateEntity();
11983
11910
  this.newTextFormat = this._textFormats[this._textFormats.length - 1];
11911
+ this.invalidate();
11984
11912
  },
11985
11913
  enumerable: true,
11986
11914
  configurable: true
@@ -12210,10 +12138,7 @@ var TextField = /** @class */ (function (_super) {
12210
12138
  this._textFormatsIdx = [this._iText.length];
12211
12139
  this._textDirty = true;
12212
12140
  //console.log("set text", value, "on" , this);
12213
- if (this._autoSize != TextFieldAutoSize.NONE)
12214
- this.invalidate();
12215
- else
12216
- this._updateEntity();
12141
+ this.invalidate();
12217
12142
  },
12218
12143
  enumerable: true,
12219
12144
  configurable: true
@@ -12226,10 +12151,7 @@ var TextField = /** @class */ (function (_super) {
12226
12151
  this._textDirty = false;
12227
12152
  this._positionsDirty = false;
12228
12153
  this._glyphsDirty = true;
12229
- if (this._autoSize != TextFieldAutoSize.NONE)
12230
- this.invalidate();
12231
- else
12232
- this._updateEntity();
12154
+ this.invalidate();
12233
12155
  };
12234
12156
  Object.defineProperty(TextField.prototype, "newTextFormat", {
12235
12157
  get: function () {
@@ -12267,34 +12189,11 @@ var TextField = /** @class */ (function (_super) {
12267
12189
  // this._shapesDirty = true;
12268
12190
  this._textDirty = true;
12269
12191
  //this.reConstruct();
12270
- if (this._autoSize != TextFieldAutoSize.NONE)
12271
- this.invalidate();
12272
- else
12273
- this._updateEntity();
12192
+ this.invalidate();
12274
12193
  },
12275
12194
  enumerable: true,
12276
12195
  configurable: true
12277
12196
  });
12278
- /**
12279
- *
12280
- * @param renderer
12281
- *
12282
- * @internal
12283
- */
12284
- TextField.prototype._acceptTraverser = function (traverser) {
12285
- if (!this.maskMode) {
12286
- //if(!this.cursorBlinking && this._isInFocus && this.cursorShape && this._type==TextFieldType.INPUT){
12287
- // traverser[this.cursorShape.elements.traverseName](this.cursorShape);
12288
- //}
12289
- this._graphics._acceptTraverser(traverser);
12290
- //if(this.showSelection && this._isInFocus && this.bgShapeSelect){
12291
- // traverser[this.bgShapeSelect.elements.traverseName](this.bgShapeSelect);
12292
- //}
12293
- //if(this.bgShape){// && this.background){
12294
- // traverser[this.bgShape.elements.traverseName](this.bgShape);
12295
- //}
12296
- }
12297
- };
12298
12197
  Object.defineProperty(TextField.prototype, "scaleX", {
12299
12198
  /**
12300
12199
  * Indicates the horizontal scale(percentage) of the object as applied from
@@ -12372,7 +12271,7 @@ var TextField = /** @class */ (function (_super) {
12372
12271
  this._implicitPartition.invalidateEntity(this);
12373
12272
  //}*/
12374
12273
  this._glyphsDirty = true;
12375
- this._updateEntity();
12274
+ this.invalidate();
12376
12275
  },
12377
12276
  enumerable: true,
12378
12277
  configurable: true
@@ -12429,12 +12328,10 @@ var TextField = /** @class */ (function (_super) {
12429
12328
  return this._type;
12430
12329
  },
12431
12330
  set: function (value) {
12432
- if (this._type == value) {
12331
+ if (this._type == value)
12433
12332
  return;
12434
- }
12435
12333
  this._type = value;
12436
12334
  this._textDirty = true;
12437
- this._updateEntity();
12438
12335
  if (value == TextFieldType.INPUT) {
12439
12336
  //this._selectable=true;
12440
12337
  this.enableInput(true);
@@ -12444,6 +12341,7 @@ var TextField = /** @class */ (function (_super) {
12444
12341
  this.enableInput(false);
12445
12342
  this.removeEventListener(KeyboardEvent.KEYDOWN, this.onKeyDelegate);
12446
12343
  }
12344
+ this.invalidate();
12447
12345
  },
12448
12346
  enumerable: true,
12449
12347
  configurable: true
@@ -12510,7 +12408,7 @@ var TextField = /** @class */ (function (_super) {
12510
12408
  //override for textfield
12511
12409
  };
12512
12410
  TextField.prototype.getEntity = function () {
12513
- return this;
12411
+ return this._graphics;
12514
12412
  };
12515
12413
  TextField.prototype.clear = function () {
12516
12414
  _super.prototype.clear.call(this);
@@ -13125,7 +13023,6 @@ var TextField = /** @class */ (function (_super) {
13125
13023
  }
13126
13024
  }
13127
13025
  }
13128
- this.updateMaskMode();
13129
13026
  };
13130
13027
  TextField.prototype.buildGlyphsForLabelData = function () {
13131
13028
  this._clearTextShapes();
@@ -13401,10 +13298,7 @@ var TextField = /** @class */ (function (_super) {
13401
13298
  }
13402
13299
  this._iText += newText;
13403
13300
  this._textDirty = true;
13404
- if (this._autoSize != TextFieldAutoSize.NONE)
13405
- this.invalidate();
13406
- else
13407
- this._updateEntity();
13301
+ this.invalidate();
13408
13302
  };
13409
13303
  /**
13410
13304
  * *tells the Textfield that a paragraph is defined completly.
@@ -13413,10 +13307,7 @@ var TextField = /** @class */ (function (_super) {
13413
13307
  TextField.prototype.closeParagraph = function () {
13414
13308
  this._iText += '\n';
13415
13309
  this._textDirty = true;
13416
- if (this._autoSize != TextFieldAutoSize.NONE)
13417
- this.invalidate();
13418
- else
13419
- this._updateEntity();
13310
+ this.invalidate();
13420
13311
  };
13421
13312
  /**
13422
13313
  * Returns a rectangle that is the bounding box of the character.
@@ -14256,8 +14147,7 @@ var TextField = /** @class */ (function (_super) {
14256
14147
  TextField.assetType = '[asset TextField]';
14257
14148
  TextField._onChangedEvent = new TextfieldEvent(TextfieldEvent.CHANGED);
14258
14149
  return TextField;
14259
- }(DisplayObjectContainer));
14260
- _awayjs_view.PartitionBase.registerAbstraction(_awayjs_view.EntityNode, TextField);
14150
+ }(DisplayObjectContainer));
14261
14151
 
14262
14152
  var CastError = /** @class */ (function (_super) {
14263
14153
  __extends(CastError, _super);
@@ -15102,7 +14992,6 @@ var MouseManager = /** @class */ (function () {
15102
14992
  this._isAVM1Dragging = false;
15103
14993
  this._isDown = false;
15104
14994
  this._stage = stage;
15105
- this.onClick = this.onClick.bind(this);
15106
14995
  this.onDoubleClick = this.onDoubleClick.bind(this);
15107
14996
  this.onMouseDown = this.onMouseDown.bind(this);
15108
14997
  this.onMouseMove = this.onMouseMove.bind(this);
@@ -15118,15 +15007,12 @@ var MouseManager = /** @class */ (function () {
15118
15007
  this._mouseDragging = false;
15119
15008
  //register stage
15120
15009
  var container = this._stage.container;
15121
- container.addEventListener('click', this.onClick);
15122
- container.addEventListener('dblclick', this.onClick);
15123
15010
  container.addEventListener('touchstart', this.onMouseDown);
15124
15011
  container.addEventListener('mousedown', this.onMouseDown);
15125
15012
  window.addEventListener('touchmove', this.onMouseMove);
15126
15013
  window.addEventListener('mousemove', this.onMouseMove);
15127
15014
  window.addEventListener('mouseup', this.onMouseUp);
15128
15015
  container.addEventListener('touchend', this.onMouseUp);
15129
- container.addEventListener('touchend', this.onClick);
15130
15016
  container.addEventListener('mousewheel', this.onMouseWheel);
15131
15017
  container.addEventListener('mouseover', this.onMouseOver);
15132
15018
  container.addEventListener('mouseout', this.onMouseOut);
@@ -15200,7 +15086,6 @@ var MouseManager = /** @class */ (function () {
15200
15086
  MouseManager.prototype.dispose = function () {
15201
15087
  //unregister stage
15202
15088
  var container = this._stage.container;
15203
- container.removeEventListener('click', this.onClick);
15204
15089
  container.removeEventListener('dblclick', this.onDoubleClick);
15205
15090
  container.removeEventListener('touchstart', this.onMouseDown);
15206
15091
  container.removeEventListener('mousedown', this.onMouseDown);
@@ -15208,7 +15093,6 @@ var MouseManager = /** @class */ (function () {
15208
15093
  window.removeEventListener('mousemove', this.onMouseMove);
15209
15094
  window.removeEventListener('mouseup', this.onMouseUp);
15210
15095
  container.removeEventListener('touchend', this.onMouseUp);
15211
- container.removeEventListener('touchend', this.onClick);
15212
15096
  container.removeEventListener('wheel', this.onMouseWheel);
15213
15097
  container.removeEventListener('mouseover', this.onMouseOver);
15214
15098
  container.removeEventListener('mouseout', this.onMouseOut);
@@ -15290,6 +15174,7 @@ var MouseManager = /** @class */ (function () {
15290
15174
  event.ctrlKey = sourceEvent.ctrlKey;
15291
15175
  event.altKey = sourceEvent.altKey;
15292
15176
  event.shiftKey = sourceEvent.shiftKey;
15177
+ event.buttons = sourceEvent.buttons;
15293
15178
  }
15294
15179
  event = this.setUpEvent(event, collision, commonAncestor);
15295
15180
  this.dispatchEvent(event, event.rootNode);
@@ -15356,25 +15241,16 @@ var MouseManager = /** @class */ (function () {
15356
15241
  && this._mouseDragCollision.rootNode != dispatcher) {
15357
15242
  // no avm1dragging is in process, but current collision
15358
15243
  // is not the same as collision that appeared on mouse-down,
15359
- // need to dispatch a MOUSE_UP_OUTSIDE on _mouseDragEntity
15360
- if (this._mouseDragCollision.rootNode.buttonEnabled)
15361
- this.setupAndDispatchEvent(this._mouseOut, event, this._mouseDragCollision);
15362
- if (!this._eventBubbling) {
15363
- this.setupAndDispatchEvent(this._mouseUpOutside, event, this._mouseDragCollision);
15364
- }
15244
+ // need to dispatch a MOUSE_UP_OUTSIDE after mouse up
15365
15245
  }
15366
15246
  else if (this._mouseDragging && this._mouseDragCollision
15367
15247
  && this._mouseDragCollision.rootNode == dispatcher) {
15368
15248
  // no avm1dragging is in process,
15369
- // but current collision is not the same as collision that appeared on mouse-down,
15370
- // need to dispatch a MOUSE_UP_OUTSIDE on _mouseDragEntity
15249
+ // current collision is the same as collision that appeared on
15250
+ // mouse-down, need to dispatch a MOUSE_CLICK event after mouse up
15371
15251
  upRootNode = this._mouseDragCollision.rootNode;
15372
15252
  upContainerNode = this._mouseDragCollision.containerNode;
15373
15253
  }
15374
- if (this._mouseDragging && dispatcher)
15375
- this.setupAndDispatchEvent(this._mouseOver, event, collision);
15376
- if (this._isTouch && upContainerNode)
15377
- this.setupAndDispatchEvent(this._mouseOut, this._mouseMoveEvent, this._mouseDragCollision);
15378
15254
  if (upRootNode) {
15379
15255
  //console.log("onRelease", upRootNode)
15380
15256
  this.dispatchEvent(event, upRootNode);
@@ -15383,8 +15259,14 @@ var MouseManager = /** @class */ (function () {
15383
15259
  this.dispatchEvent(event, dispatcher);
15384
15260
  else if (this._eventBubbling)
15385
15261
  this._stage.dispatchEvent(event);
15386
- if (upContainerNode)
15262
+ if (upContainerNode) {
15263
+ if (!this._isAVM1Dragging)
15264
+ this.setupAndDispatchEvent(this._mouseClick, this._isTouch ? this._mouseMoveEvent : event, this._mouseDragCollision);
15387
15265
  this.setupAndDispatchEvent(this._dragStop, event, this._mouseDragCollision);
15266
+ }
15267
+ else if (this._mouseDragging && this._mouseDragCollision) {
15268
+ this.setupAndDispatchEvent(this._mouseUpOutside, event, this._mouseDragCollision);
15269
+ }
15388
15270
  this._mouseDragCollision = null;
15389
15271
  this._mouseDragging = false;
15390
15272
  this._isAVM1Dragging = false;
@@ -15418,14 +15300,13 @@ var MouseManager = /** @class */ (function () {
15418
15300
  var prevCollisionNode = (_d = this._prevCollision) === null || _d === void 0 ? void 0 : _d.rootNode;
15419
15301
  if (collisionNode != prevCollisionNode) {
15420
15302
  // If colliding object has changed, queue OVER and OUT events.
15421
- // If the mouse is dragged (mouse-down is hold), use DRAG_OVER and DRAG_OUT instead of MOUSE_OVER MOUSE_OUT
15303
+ // If the mouse is dragged (mouse-down is hold), use DRAG_OVER and DRAG_OUT as well as MOUSE_OVER MOUSE_OUT
15422
15304
  // DRAG_OVER and DRAG_OUT are only dispatched on the object that was hit on the mouse-down
15423
15305
  // (_mouseDragEntity)
15424
15306
  // Store the info if the collision is a enabled Button (_collisionIsEnabledButton)
15425
15307
  if (prevCollisionNode) {
15426
- if (!this._isTouch && !this._mouseDragging)
15427
- this.setupAndDispatchEvent(this._mouseOut, this._mouseMoveEvent, this._prevCollision);
15428
- else if (this._mouseDragging && this._mouseDragCollision
15308
+ this.setupAndDispatchEvent(this._mouseOut, this._mouseMoveEvent, this._prevCollision);
15309
+ if (this._mouseDragging && this._mouseDragCollision
15429
15310
  && this._mouseDragCollision.rootNode == prevCollisionNode)
15430
15311
  this.setupAndDispatchEvent(this._dragOut, this._mouseMoveEvent, this._prevCollision);
15431
15312
  }
@@ -15466,10 +15347,8 @@ var MouseManager = /** @class */ (function () {
15466
15347
  }
15467
15348
  this._collisionIsEnabledButton = collisionNode ? collisionNode.buttonEnabled : false;
15468
15349
  if (collisionNode) {
15469
- if (!this._isTouch && !this._mouseDragging)
15470
- this.setupAndDispatchEvent(this._mouseOver, this._mouseMoveEvent, collision);
15471
- else if (this._mouseDragging && this._mouseDragCollision &&
15472
- this._mouseDragCollision.rootNode == collisionNode)
15350
+ this.setupAndDispatchEvent(this._mouseOver, this._mouseMoveEvent, collision);
15351
+ if (this._mouseDragging)
15473
15352
  this.setupAndDispatchEvent(this._dragOver, this._mouseMoveEvent, collision);
15474
15353
  }
15475
15354
  this._prevCollision = collision;
@@ -15693,7 +15572,7 @@ var MouseManager = /** @class */ (function () {
15693
15572
  event.ctrlKey = sourceEvent.ctrlKey;
15694
15573
  event.altKey = sourceEvent.altKey;
15695
15574
  event.shiftKey = sourceEvent.shiftKey;
15696
- event.button = (sourceEvent instanceof MouseEvent) ? sourceEvent.button : 0;
15575
+ event.buttons = (sourceEvent instanceof MouseEvent) ? sourceEvent.buttons : 0;
15697
15576
  this._queuedEvents.push(event);
15698
15577
  };
15699
15578
  // ---------------------------------------------------------------------
@@ -15771,11 +15650,6 @@ var MouseManager = /** @class */ (function () {
15771
15650
  this.updateColliders(event);
15772
15651
  this.queueDispatch(this._mouseOver, event);
15773
15652
  };
15774
- MouseManager.prototype.onClick = function (event) {
15775
- !MouseManager.inputRecorder || MouseManager.inputRecorder.recordEvent(event);
15776
- this.updateColliders(event);
15777
- this.queueDispatch(this._mouseClick, event);
15778
- };
15779
15653
  MouseManager.prototype.onDoubleClick = function (event) {
15780
15654
  !MouseManager.inputRecorder || MouseManager.inputRecorder.recordEvent(event);
15781
15655
  this.updateColliders(event);
@@ -18299,7 +18173,7 @@ var Scene = /** @class */ (function () {
18299
18173
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18300
18174
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18301
18175
 
18302
- console.debug('AwayJS - Scene - 0.13.247');
18176
+ console.debug('AwayJS - Scene - 0.13.249');
18303
18177
 
18304
18178
  exports.Timeline = Timeline;
18305
18179
  exports.ControllerBase = ControllerBase;