@awayjs/scene 0.13.253 → 0.13.255

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.
@@ -6849,7 +6849,6 @@ var MovieClip = /** @class */ (function (_super) {
6849
6849
  */
6850
6850
  _this.constructedKeyFrameIndex = -1;
6851
6851
  _this._soundVolume = 1;
6852
- _this._parentSoundVolume = 1;
6853
6852
  _this._isButton = false;
6854
6853
  _this._buttonMode = false;
6855
6854
  _this._useHandCursor = true;
@@ -6960,6 +6959,7 @@ var MovieClip = /** @class */ (function (_super) {
6960
6959
  };
6961
6960
  MovieClip.prototype.startSound = function (sound, loopsToPlay, onSoundComplete) {
6962
6961
  var channel = sound.play(0, loopsToPlay);
6962
+ channel.volume = this._soundVolume;
6963
6963
  if (onSoundComplete)
6964
6964
  channel.addEventListener(_awayjs_core_dist_lib_managers_BaseAudioChannel.BaseAudioChannel.COMPLETE, onSoundComplete);
6965
6965
  //internal listener to clear
@@ -7079,8 +7079,13 @@ var MovieClip = /** @class */ (function (_super) {
7079
7079
  return;
7080
7080
  }
7081
7081
  this._soundVolume = value;
7082
- for (var key in this._sounds) {
7083
- this._sounds[key].volume = value;
7082
+ for (var key in this._activeSounds) {
7083
+ var channels = this._activeSounds[key];
7084
+ if (channels)
7085
+ for (var _i = 0, channels_1 = channels; _i < channels_1.length; _i++) {
7086
+ var c = channels_1[_i];
7087
+ c.volume = value;
7088
+ }
7084
7089
  }
7085
7090
  var len = this._children.length;
7086
7091
  var child;
@@ -7102,8 +7107,8 @@ var MovieClip = /** @class */ (function (_super) {
7102
7107
  }
7103
7108
  var channels = this._activeSounds[sound.id];
7104
7109
  if (channels) {
7105
- for (var _i = 0, channels_1 = channels; _i < channels_1.length; _i++) {
7106
- var c = channels_1[_i];
7110
+ for (var _i = 0, channels_2 = channels; _i < channels_2.length; _i++) {
7111
+ var c = channels_2[_i];
7107
7112
  c.stop();
7108
7113
  }
7109
7114
  delete this._activeSounds[sound.id];
@@ -11358,7 +11363,6 @@ var TextField = /** @class */ (function (_super) {
11358
11363
  this.maskChild.visible = false;
11359
11364
  this._graphics.clear();
11360
11365
  this.targetGraphics = this.textChild.graphics;
11361
- return;
11362
11366
  }
11363
11367
  // only use masking if needed:
11364
11368
  if (this._textWidth > this._width || this._textHeight > this._height) {
@@ -11660,9 +11664,23 @@ var TextField = /** @class */ (function (_super) {
11660
11664
  this.scrollToCursor(startx + width, oldy + height);
11661
11665
  };
11662
11666
  TextField.prototype.drawBG = function () {
11663
- this._graphics.beginFill(this.backgroundColor, (!this._background) ? 0 : 1);
11664
- this._graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11665
- this._graphics.endFill();
11667
+ //TODO this fixes masking using static textfields, but dynamic textfields still have problems. (see addChild(this.maskChild))
11668
+ if (this._background) {
11669
+ this._graphics.beginFill(this.backgroundColor, 1);
11670
+ this._graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11671
+ this._graphics.endFill();
11672
+ }
11673
+ //create a hitArea for the textfield
11674
+ var pickObject = this.pickObject;
11675
+ if (!pickObject) {
11676
+ this.pickObject = pickObject || (pickObject = new Sprite());
11677
+ pickObject.pickObjectFromTimeline = true;
11678
+ }
11679
+ var graphics = pickObject.graphics;
11680
+ graphics.clear();
11681
+ graphics.beginFill(0x000000, 1);
11682
+ graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11683
+ graphics.endFill();
11666
11684
  };
11667
11685
  TextField.prototype.drawBorder = function () {
11668
11686
  var half_thickness_x = this.border ? 0.25 * this.internalScale.x : 0;
@@ -18173,7 +18191,7 @@ var Scene = /** @class */ (function () {
18173
18191
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18174
18192
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18175
18193
 
18176
- console.debug('AwayJS - Scene - 0.13.253');
18194
+ console.debug('AwayJS - Scene - 0.13.255');
18177
18195
 
18178
18196
  exports.Timeline = Timeline;
18179
18197
  exports.ControllerBase = ControllerBase;