@awayjs/scene 0.13.245 → 0.13.246

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@awayjs/core'), require('@awayjs/view'), require('@awayjs/graphics'), require('@awayjs/stage'), require('@awayjs/renderer'), require('@awayjs/materials'), require('node-html-parser')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@awayjs/core', '@awayjs/view', '@awayjs/graphics', '@awayjs/stage', '@awayjs/renderer', '@awayjs/materials', 'node-html-parser'], factory) :
4
- (factory((global.AwayjsScene = global.AwayjsScene || {}),global.AwayjsCore,global.AwayjsView,global.AwayjsGraphics,global.AwayjsStage,global.AwayjsRenderer,global.AwayjsMaterials,global.nodeHtmlParser));
5
- }(this, (function (exports,_awayjs_core,_awayjs_view,_awayjs_graphics,_awayjs_stage,_awayjs_renderer,_awayjs_materials,nodeHtmlParser) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@awayjs/core'), require('@awayjs/stage'), require('@awayjs/view'), require('@awayjs/graphics'), require('@awayjs/renderer'), require('@awayjs/materials'), require('node-html-parser')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@awayjs/core', '@awayjs/stage', '@awayjs/view', '@awayjs/graphics', '@awayjs/renderer', '@awayjs/materials', 'node-html-parser'], factory) :
4
+ (factory((global.AwayjsScene = global.AwayjsScene || {}),global.AwayjsCore,global.AwayjsStage,global.AwayjsView,global.AwayjsGraphics,global.AwayjsRenderer,global.AwayjsMaterials,global.nodeHtmlParser));
5
+ }(this, (function (exports,_awayjs_core,_awayjs_stage,_awayjs_view,_awayjs_graphics,_awayjs_renderer,_awayjs_materials,nodeHtmlParser) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3713,7 +3713,8 @@ function mapBlendIdToString(id) {
3713
3713
  return BLEND_MODES[id] || BLEND_MODES[1];
3714
3714
  }
3715
3715
  var Timeline = /** @class */ (function () {
3716
- function Timeline() {
3716
+ function Timeline(factory) {
3717
+ this.factory = factory;
3717
3718
  this._update_indices = [];
3718
3719
  this._update_frames = [];
3719
3720
  this.isButton = false;
@@ -3731,16 +3732,6 @@ var Timeline = /** @class */ (function () {
3731
3732
  this._framescripts_translated = {};
3732
3733
  this.keyframe_to_frameidx = {};
3733
3734
  }
3734
- Object.defineProperty(Timeline.prototype, "symbolDecoder", {
3735
- get: function () {
3736
- return this._symbolDecoder;
3737
- },
3738
- set: function (value) {
3739
- this._symbolDecoder = value;
3740
- },
3741
- enumerable: true,
3742
- configurable: true
3743
- });
3744
3735
  Timeline.prototype.resetScripts = function () {
3745
3736
  this._framescripts = {};
3746
3737
  this._framescripts_translated = {};
@@ -3749,9 +3740,6 @@ var Timeline = /** @class */ (function () {
3749
3740
  prepares
3750
3741
  */
3751
3742
  Timeline.prototype.init = function () {
3752
- if (!this._symbolDecoder) {
3753
- console.warn('[Timeline] - init - no _symbolDecoder is set');
3754
- }
3755
3743
  if ((this.frame_command_indices == null) || (this.frame_recipe == null) || (this.keyframe_durations == null)) {
3756
3744
  return;
3757
3745
  }
@@ -3829,7 +3817,7 @@ var Timeline = /** @class */ (function () {
3829
3817
  if (checkForTranslation && !this._framescripts_translated[frame_idx]) {
3830
3818
  // todo: cleanup so we can retrieve className of target_mc without hacks
3831
3819
  var name_1 = target_mc.className ? target_mc.className : target_mc.name;
3832
- this._framescripts[frame_idx] = this.symbolDecoder.prepareFrameScriptsForAVM1(this._framescripts[frame_idx], frame_idx, name_1, target_mc.id);
3820
+ this._framescripts[frame_idx] = this.factory.createFrameScripts(this._framescripts[frame_idx], frame_idx, name_1, target_mc.id);
3833
3821
  this._framescripts_translated[frame_idx] = true;
3834
3822
  }
3835
3823
  return this._framescripts[frame_idx];
@@ -3847,7 +3835,7 @@ var Timeline = /** @class */ (function () {
3847
3835
  return this.keyframe_indices[frame_index];
3848
3836
  };
3849
3837
  Timeline.prototype.getChildInstance = function (symbolID, sessionID) {
3850
- return this.symbolDecoder.createChildInstanceForTimeline(this, symbolID, sessionID);
3838
+ return this.factory.createChildInstanceForTimeline(this, symbolID, sessionID);
3851
3839
  };
3852
3840
  Timeline.prototype.extractHitArea = function (target_mc) {
3853
3841
  target_mc.reset(false);
@@ -4032,7 +4020,7 @@ var Timeline = /** @class */ (function () {
4032
4020
  console.warn('[Timeline] - add_childs_continous - could not find child-id in child_stream for idx', idx, this.add_child_stream);
4033
4021
  continue;
4034
4022
  }
4035
- var childAsset = this._symbolDecoder.createChildInstanceForTimeline(this, this.add_child_stream[idx + 2], this.add_child_stream[idx]);
4023
+ var childAsset = this.factory.createChildInstanceForTimeline(this, this.add_child_stream[idx + 2], this.add_child_stream[idx]);
4036
4024
  target_mc.adapter.addTimelineChildAtDepth(childAsset, this.add_child_stream[idx + 1]);
4037
4025
  }
4038
4026
  };
@@ -6870,7 +6858,6 @@ var MouseEvent$1 = /** @class */ (function (_super) {
6870
6858
  var MovieClip = /** @class */ (function (_super) {
6871
6859
  __extends(MovieClip, _super);
6872
6860
  function MovieClip(timeline, spriteMode) {
6873
- if (timeline === void 0) { timeline = null; }
6874
6861
  if (spriteMode === void 0) { spriteMode = false; }
6875
6862
  var _this = _super.call(this) || this;
6876
6863
  _this.symbolID = 0;
@@ -6945,7 +6932,7 @@ var MovieClip = /** @class */ (function (_super) {
6945
6932
  _this._onDragOut = function (_event) {
6946
6933
  _this.currentFrameIndex = 1;
6947
6934
  };
6948
- _this._timeline = timeline || new Timeline();
6935
+ _this._timeline = timeline;
6949
6936
  if (spriteMode) {
6950
6937
  _this.transformToSprite();
6951
6938
  }
@@ -6956,10 +6943,9 @@ var MovieClip = /** @class */ (function (_super) {
6956
6943
  MovieClip._activeSoundsOwners.clear();
6957
6944
  };
6958
6945
  MovieClip.getNewMovieClip = function (timeline) {
6959
- if (timeline === void 0) { timeline = null; }
6960
6946
  if (MovieClip._movieClips.length) {
6961
6947
  var movieClip = MovieClip._movieClips.pop();
6962
- movieClip.timeline = timeline || new Timeline();
6948
+ movieClip.timeline = timeline;
6963
6949
  movieClip.graphics = _awayjs_graphics.Graphics.getGraphics();
6964
6950
  return movieClip;
6965
6951
  }
@@ -7985,6 +7971,7 @@ var Skybox = /** @class */ (function (_super) {
7985
7971
  _this.imageRect = false;
7986
7972
  _this.useColorTransform = false;
7987
7973
  _this.alphaThreshold = 0;
7974
+ _this.alphaBlending = true;
7988
7975
  _this._onTextureInvalidateDelegate = function (event) { return _this.onTextureInvalidate(event); };
7989
7976
  _this._owners = [_this];
7990
7977
  _this.style = new _awayjs_renderer.Style();
@@ -14377,12 +14364,14 @@ var ResizeEvent = /** @class */ (function (_super) {
14377
14364
  var DefaultSceneGraphFactory = /** @class */ (function (_super) {
14378
14365
  __extends(DefaultSceneGraphFactory, _super);
14379
14366
  function DefaultSceneGraphFactory() {
14380
- return _super !== null && _super.apply(this, arguments) || this;
14367
+ var _this = _super !== null && _super.apply(this, arguments) || this;
14368
+ _this.awaySymbols = {};
14369
+ return _this;
14381
14370
  }
14382
14371
  DefaultSceneGraphFactory.prototype.createMovieClip = function (timeline, symbol) {
14383
14372
  if (timeline === void 0) { timeline = null; }
14384
14373
  if (symbol === void 0) { symbol = null; }
14385
- return new MovieClip(timeline);
14374
+ return new MovieClip(timeline || new Timeline(this));
14386
14375
  };
14387
14376
  DefaultSceneGraphFactory.prototype.createSprite = function (prefab, graphics, symbol) {
14388
14377
  if (prefab === void 0) { prefab = null; }
@@ -14411,8 +14400,11 @@ var DefaultSceneGraphFactory = /** @class */ (function (_super) {
14411
14400
  DefaultSceneGraphFactory.prototype.createFrameScripts = function (scripts, frameIdx, objName, objID) {
14412
14401
  throw ('[DefaultSceneGraphFactory] - createFrameScripts should be overwritten by AVM');
14413
14402
  };
14403
+ DefaultSceneGraphFactory.prototype.createChildInstanceForTimeline = function (timeline, symbolID, sessionID) {
14404
+ throw ('[DefaultSceneGraphFactory] - createChildInstanceForTimeline should be overwritten by AVM');
14405
+ };
14414
14406
  return DefaultSceneGraphFactory;
14415
- }(_awayjs_stage.DefaultGraphicsFactory));
14407
+ }(_awayjs_stage.DefaultStageFactory));
14416
14408
 
14417
14409
  // empty matrix for transform reset
14418
14410
  var TMP_POINT = new _awayjs_core.Point(0, 0);
@@ -18325,7 +18317,7 @@ var Scene = /** @class */ (function () {
18325
18317
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18326
18318
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18327
18319
 
18328
- console.debug('AwayJS - Scene - 0.13.245');
18320
+ console.debug('AwayJS - Scene - 0.13.246');
18329
18321
 
18330
18322
  exports.Timeline = Timeline;
18331
18323
  exports.ControllerBase = ControllerBase;