@awayjs/scene 0.13.258 → 0.13.260

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 (66) hide show
  1. package/bundle/awayjs-scene.umd.js +3 -18334
  2. package/bundle/awayjs-scene.umd.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/lib/Scene.js +14 -14
  5. package/dist/lib/adapters/IDisplayObjectAdapter.js +1 -0
  6. package/dist/lib/adapters/IFilter.js +1 -0
  7. package/dist/lib/adapters/IMovieClipAdapter.js +1 -0
  8. package/dist/lib/adapters/ITextfieldAdapter.js +1 -0
  9. package/dist/lib/base/IBitmapDrawable.js +1 -0
  10. package/dist/lib/base/IFrameLabel.js +1 -0
  11. package/dist/lib/base/IFrameScript.js +1 -0
  12. package/dist/lib/base/MouseButtons.js +1 -0
  13. package/dist/lib/base/Timeline.d.ts +1 -1
  14. package/dist/lib/base/Timeline.d.ts.map +1 -1
  15. package/dist/lib/base/Timeline.js +17 -17
  16. package/dist/lib/base/TimelineActionType.js +1 -0
  17. package/dist/lib/controllers/ControllerBase.js +2 -2
  18. package/dist/lib/controllers/FirstPersonController.js +6 -6
  19. package/dist/lib/controllers/HoverController.js +10 -10
  20. package/dist/lib/controllers/LookAtController.js +2 -2
  21. package/dist/lib/display/Billboard.js +11 -10
  22. package/dist/lib/display/Camera.js +2 -2
  23. package/dist/lib/display/DisplayObject.js +46 -46
  24. package/dist/lib/display/DisplayObjectContainer.js +3 -3
  25. package/dist/lib/display/LineSegment.js +4 -4
  26. package/dist/lib/display/LoaderContainer.js +2 -2
  27. package/dist/lib/display/MorphSprite.js +1 -1
  28. package/dist/lib/display/MovieClip.d.ts.map +1 -1
  29. package/dist/lib/display/MovieClip.js +18 -18
  30. package/dist/lib/display/SimpleButton.js +8 -8
  31. package/dist/lib/display/Skybox.js +5 -5
  32. package/dist/lib/display/Sprite.js +2 -2
  33. package/dist/lib/display/TextField.js +45 -45
  34. package/dist/lib/elements/SkyboxElements.js +1 -1
  35. package/dist/lib/events/CameraEvent.js +1 -1
  36. package/dist/lib/events/KeyboardEvent.js +2 -2
  37. package/dist/lib/events/MouseEvent.js +3 -3
  38. package/dist/lib/events/ResizeEvent.js +2 -2
  39. package/dist/lib/factories/ISceneGraphFactory.js +1 -0
  40. package/dist/lib/image/SceneImage2D.js +3 -3
  41. package/dist/lib/managers/DeviceFontManager.js +6 -6
  42. package/dist/lib/managers/IInputRecorder.js +1 -0
  43. package/dist/lib/managers/MouseManager.js +11 -12
  44. package/dist/lib/prefabs/PrimitiveCapsulePrefab.js +5 -5
  45. package/dist/lib/prefabs/PrimitiveConePrefab.js +1 -1
  46. package/dist/lib/prefabs/PrimitiveCubePrefab.js +7 -7
  47. package/dist/lib/prefabs/PrimitiveCylinderPrefab.js +8 -8
  48. package/dist/lib/prefabs/PrimitivePlanePrefab.js +6 -6
  49. package/dist/lib/prefabs/PrimitivePolygonPrefab.js +3 -3
  50. package/dist/lib/prefabs/PrimitivePrefabBase.js +5 -5
  51. package/dist/lib/prefabs/PrimitiveSpherePrefab.js +4 -4
  52. package/dist/lib/prefabs/PrimitiveTorusPrefab.js +5 -5
  53. package/dist/lib/text/BitmapFontTable.js +7 -7
  54. package/dist/lib/text/Font.js +4 -4
  55. package/dist/lib/text/IFontTable.js +1 -0
  56. package/dist/lib/text/TesselatedFontTable.js +20 -11
  57. package/dist/lib/text/TextFormat.js +18 -18
  58. package/dist/lib/text/TextShape.js +3 -3
  59. package/dist/lib/tools/Merge.js +3 -3
  60. package/dist/lib/utils/Cast.js +3 -3
  61. package/index.ts +1 -1
  62. package/lib/display/MovieClip.ts +2 -2
  63. package/package.json +10 -10
  64. package/rollup.config.js +30 -29
  65. package/bundle/awayjs-scene.umd.min.js +0 -1
  66. package/bundle/awayjs-scene.umd.min.js.map +0 -1
@@ -390,7 +390,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
390
390
  get: function () {
391
391
  return this._usesCurves;
392
392
  },
393
- enumerable: true,
393
+ enumerable: false,
394
394
  configurable: true
395
395
  });
396
396
  TesselatedFontTable.prototype.getLineHeight = function () {
@@ -407,7 +407,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
407
407
  get: function () {
408
408
  return TesselatedFontTable.assetType;
409
409
  },
410
- enumerable: true,
410
+ enumerable: false,
411
411
  configurable: true
412
412
  });
413
413
  TesselatedFontTable.prototype.dispose = function () {
@@ -424,7 +424,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
424
424
  set: function (value) {
425
425
  this._fntSizeLimit = value;
426
426
  },
427
- enumerable: true,
427
+ enumerable: false,
428
428
  configurable: true
429
429
  });
430
430
  Object.defineProperty(TesselatedFontTable.prototype, "ascent", {
@@ -434,7 +434,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
434
434
  set: function (value) {
435
435
  this._ascent = value;
436
436
  },
437
- enumerable: true,
437
+ enumerable: false,
438
438
  configurable: true
439
439
  });
440
440
  Object.defineProperty(TesselatedFontTable.prototype, "descent", {
@@ -444,7 +444,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
444
444
  set: function (value) {
445
445
  this._descent = value;
446
446
  },
447
- enumerable: true,
447
+ enumerable: false,
448
448
  configurable: true
449
449
  });
450
450
  Object.defineProperty(TesselatedFontTable.prototype, "offset_x", {
@@ -454,7 +454,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
454
454
  set: function (value) {
455
455
  this._offset_x = value;
456
456
  },
457
- enumerable: true,
457
+ enumerable: false,
458
458
  configurable: true
459
459
  });
460
460
  Object.defineProperty(TesselatedFontTable.prototype, "offset_y", {
@@ -464,7 +464,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
464
464
  set: function (value) {
465
465
  this._offset_y = value;
466
466
  },
467
- enumerable: true,
467
+ enumerable: false,
468
468
  configurable: true
469
469
  });
470
470
  TesselatedFontTable.prototype.get_font_chars = function () {
@@ -513,7 +513,10 @@ var TesselatedFontTable = /** @class */ (function (_super) {
513
513
  var charVertices = charGlyph.fill_data;
514
514
  if (charVertices) {
515
515
  charEntries.push({
516
- char: charGlyph, x: x, y: y, selected: false
516
+ char: charGlyph,
517
+ x: x,
518
+ y: y,
519
+ selected: false
517
520
  });
518
521
  textBuffSize += charVertices.buffer.byteLength / 4;
519
522
  }
@@ -578,13 +581,19 @@ var TesselatedFontTable = /** @class */ (function (_super) {
578
581
  }
579
582
  if (curTShape === textShapeSelected) {
580
583
  selectedCharEntries.push({
581
- char: charGlyph, x: x, y: y, selected: true
584
+ char: charGlyph,
585
+ x: x,
586
+ y: y,
587
+ selected: true
582
588
  });
583
589
  selectedBuffSize += charGlyph.fill_data.buffer.byteLength / 4;
584
590
  }
585
591
  else {
586
592
  charEntries.push({
587
- char: charGlyph, x: x, y: y, selected: false
593
+ char: charGlyph,
594
+ x: x,
595
+ y: y,
596
+ selected: false
588
597
  });
589
598
  textBuffSize += charGlyph.fill_data.buffer.byteLength / 4;
590
599
  }
@@ -632,7 +641,7 @@ var TesselatedFontTable = /** @class */ (function (_super) {
632
641
  if (color === void 0) { color = 0xffffff; }
633
642
  if (channel === void 0) { channel = -1; }
634
643
  var fnt = channel >= 0;
635
- return "" + color + fnt + (fnt ? channel : 0);
644
+ return "".concat(color).concat(fnt).concat(fnt ? channel : 0);
636
645
  };
637
646
  /**
638
647
  * Query shape from TextField cache
@@ -132,7 +132,7 @@ var TextFormat = /** @class */ (function (_super) {
132
132
  get: function () {
133
133
  return this._updateID;
134
134
  },
135
- enumerable: true,
135
+ enumerable: false,
136
136
  configurable: true
137
137
  });
138
138
  /**
@@ -153,7 +153,7 @@ var TextFormat = /** @class */ (function (_super) {
153
153
  }
154
154
  this._align = value;
155
155
  },
156
- enumerable: true,
156
+ enumerable: false,
157
157
  configurable: true
158
158
  });
159
159
  Object.defineProperty(TextFormat.prototype, "blockIndent", {
@@ -166,7 +166,7 @@ var TextFormat = /** @class */ (function (_super) {
166
166
  }
167
167
  this._blockIndent = value;
168
168
  },
169
- enumerable: true,
169
+ enumerable: false,
170
170
  configurable: true
171
171
  });
172
172
  Object.defineProperty(TextFormat.prototype, "leftMargin", {
@@ -179,7 +179,7 @@ var TextFormat = /** @class */ (function (_super) {
179
179
  }
180
180
  this._leftMargin = value;
181
181
  },
182
- enumerable: true,
182
+ enumerable: false,
183
183
  configurable: true
184
184
  });
185
185
  Object.defineProperty(TextFormat.prototype, "rightMargin", {
@@ -192,7 +192,7 @@ var TextFormat = /** @class */ (function (_super) {
192
192
  }
193
193
  this._rightMargin = value;
194
194
  },
195
- enumerable: true,
195
+ enumerable: false,
196
196
  configurable: true
197
197
  });
198
198
  Object.defineProperty(TextFormat.prototype, "indent", {
@@ -205,7 +205,7 @@ var TextFormat = /** @class */ (function (_super) {
205
205
  }
206
206
  this._indent = value;
207
207
  },
208
- enumerable: true,
208
+ enumerable: false,
209
209
  configurable: true
210
210
  });
211
211
  Object.defineProperty(TextFormat.prototype, "color", {
@@ -218,7 +218,7 @@ var TextFormat = /** @class */ (function (_super) {
218
218
  }
219
219
  this._color = value;
220
220
  },
221
- enumerable: true,
221
+ enumerable: false,
222
222
  configurable: true
223
223
  });
224
224
  Object.defineProperty(TextFormat.prototype, "kerning", {
@@ -231,7 +231,7 @@ var TextFormat = /** @class */ (function (_super) {
231
231
  }
232
232
  this._kerning = value;
233
233
  },
234
- enumerable: true,
234
+ enumerable: false,
235
235
  configurable: true
236
236
  });
237
237
  Object.defineProperty(TextFormat.prototype, "leading", {
@@ -244,7 +244,7 @@ var TextFormat = /** @class */ (function (_super) {
244
244
  }
245
245
  this._leading = value;
246
246
  },
247
- enumerable: true,
247
+ enumerable: false,
248
248
  configurable: true
249
249
  });
250
250
  Object.defineProperty(TextFormat.prototype, "letterSpacing", {
@@ -257,7 +257,7 @@ var TextFormat = /** @class */ (function (_super) {
257
257
  }
258
258
  this._letterSpacing = value;
259
259
  },
260
- enumerable: true,
260
+ enumerable: false,
261
261
  configurable: true
262
262
  });
263
263
  Object.defineProperty(TextFormat.prototype, "size", {
@@ -270,7 +270,7 @@ var TextFormat = /** @class */ (function (_super) {
270
270
  }
271
271
  this._size = value;
272
272
  },
273
- enumerable: true,
273
+ enumerable: false,
274
274
  configurable: true
275
275
  });
276
276
  Object.defineProperty(TextFormat.prototype, "bold", {
@@ -284,7 +284,7 @@ var TextFormat = /** @class */ (function (_super) {
284
284
  this._bold = value;
285
285
  this._fontTableDirty = true;
286
286
  },
287
- enumerable: true,
287
+ enumerable: false,
288
288
  configurable: true
289
289
  });
290
290
  Object.defineProperty(TextFormat.prototype, "italic", {
@@ -298,7 +298,7 @@ var TextFormat = /** @class */ (function (_super) {
298
298
  this._italic = value;
299
299
  this._fontTableDirty = true;
300
300
  },
301
- enumerable: true,
301
+ enumerable: false,
302
302
  configurable: true
303
303
  });
304
304
  Object.defineProperty(TextFormat.prototype, "underline", {
@@ -311,7 +311,7 @@ var TextFormat = /** @class */ (function (_super) {
311
311
  }
312
312
  this._underline = value;
313
313
  },
314
- enumerable: true,
314
+ enumerable: false,
315
315
  configurable: true
316
316
  });
317
317
  Object.defineProperty(TextFormat.prototype, "font_table", {
@@ -327,7 +327,7 @@ var TextFormat = /** @class */ (function (_super) {
327
327
  this._font_table = value;
328
328
  this._fontTableDirty = false;
329
329
  },
330
- enumerable: true,
330
+ enumerable: false,
331
331
  configurable: true
332
332
  });
333
333
  Object.defineProperty(TextFormat.prototype, "font_name", {
@@ -351,7 +351,7 @@ var TextFormat = /** @class */ (function (_super) {
351
351
  this._fontTableDirty = true;
352
352
  this._updateID++;
353
353
  },
354
- enumerable: true,
354
+ enumerable: false,
355
355
  configurable: true
356
356
  });
357
357
  TextFormat.prototype.update_font_table = function () {
@@ -383,7 +383,7 @@ var TextFormat = /** @class */ (function (_super) {
383
383
  this._fontTableDirty = true;
384
384
  this._updateID++;
385
385
  },
386
- enumerable: true,
386
+ enumerable: false,
387
387
  configurable: true
388
388
  });
389
389
  TextFormat.prototype.clone = function () {
@@ -431,7 +431,7 @@ var TextFormat = /** @class */ (function (_super) {
431
431
  get: function () {
432
432
  return TextFormat.assetType;
433
433
  },
434
- enumerable: true,
434
+ enumerable: false,
435
435
  configurable: true
436
436
  });
437
437
  TextFormat.assetType = '[asset TextFormat]';
@@ -40,14 +40,14 @@ var TextShape = /** @class */ (function () {
40
40
  verts.length = index;
41
41
  this._length = val;
42
42
  },
43
- enumerable: true,
43
+ enumerable: false,
44
44
  configurable: true
45
45
  });
46
46
  Object.defineProperty(TextShape.prototype, "hasUV", {
47
47
  get: function () {
48
48
  return this.uvs.length > 0;
49
49
  },
50
- enumerable: true,
50
+ enumerable: false,
51
51
  configurable: true
52
52
  });
53
53
  TextShape.prototype.addChunk = function (buffer, uvs) {
@@ -67,7 +67,7 @@ var TextShape = /** @class */ (function () {
67
67
  get: function () {
68
68
  return this.verts[this.verts.length - 1];
69
69
  },
70
- enumerable: true,
70
+ enumerable: false,
71
71
  configurable: true
72
72
  });
73
73
  return TextShape;
@@ -36,7 +36,7 @@ var Merge = /** @class */ (function () {
36
36
  set: function (b) {
37
37
  this._disposeSources = b;
38
38
  },
39
- enumerable: true,
39
+ enumerable: false,
40
40
  configurable: true
41
41
  });
42
42
  Object.defineProperty(Merge.prototype, "keepMaterial", {
@@ -49,7 +49,7 @@ var Merge = /** @class */ (function () {
49
49
  set: function (b) {
50
50
  this._keepMaterial = b;
51
51
  },
52
- enumerable: true,
52
+ enumerable: false,
53
53
  configurable: true
54
54
  });
55
55
  Object.defineProperty(Merge.prototype, "objectSpace", {
@@ -62,7 +62,7 @@ var Merge = /** @class */ (function () {
62
62
  set: function (b) {
63
63
  this._objectSpace = b;
64
64
  },
65
- enumerable: true,
65
+ enumerable: false,
66
66
  configurable: true
67
67
  });
68
68
  /**
@@ -33,8 +33,8 @@ var Cast = /** @class */ (function () {
33
33
  // return XML(data);
34
34
  // }
35
35
  Cast.isHex = function (str) {
36
- var length = str.length;
37
- for (var i = 0; i < length; ++i) {
36
+ var length /*int*/ = str.length;
37
+ for (var i /*int*/ = 0; i < length; ++i) {
38
38
  if (this._hexChars.indexOf(str.charAt(i)) == -1)
39
39
  return false;
40
40
  }
@@ -198,7 +198,7 @@ var Cast = /** @class */ (function () {
198
198
  return null;
199
199
  };
200
200
  Cast.color = function (data) {
201
- var result = this.tryColor(data);
201
+ var result /*uint*/ = this.tryColor(data);
202
202
  if (result == null)
203
203
  throw new CastError('Can\'t cast to color: ' + data);
204
204
  return result;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.258');
1
+ console.debug('AwayJS - Scene - 0.13.260');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -1,4 +1,4 @@
1
- import { WaveAudio, IAudioChannel, EventBase } from '@awayjs/core';
1
+ import { WaveAudio, IAudioChannel, EventBase, BaseAudioChannel } from '@awayjs/core';
2
2
  import { PartitionBase, EntityNode } from '@awayjs/view';
3
3
  import { IMovieClipAdapter } from '../adapters/IMovieClipAdapter';
4
4
  import { Timeline } from '../base/Timeline';
@@ -8,7 +8,7 @@ import { DisplayObject } from './DisplayObject';
8
8
  import { Sprite } from './Sprite';
9
9
  import { DisplayObjectContainer } from './DisplayObjectContainer';
10
10
  import { MouseButtons } from '../base/MouseButtons';
11
- import { BaseAudioChannel } from '@awayjs/core/dist/lib/managers/BaseAudioChannel';
11
+
12
12
  interface IScene {
13
13
  offset: number;
14
14
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.258",
3
+ "version": "0.13.260",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",
@@ -14,7 +14,6 @@
14
14
  "scripts": {
15
15
  "rimraf": "rimraf",
16
16
  "rollup": "rollup -c",
17
- "uglifyjs": "uglifyjs ./bundle/awayjs-scene.umd.js -o ./bundle/awayjs-scene.umd.min.js --source-map \"content='./bundle/awayjs-scene.umd.js.map'\" --mangle",
18
17
  "tsc": "tsc",
19
18
  "tsc:build": "npm run tsc || exit 0",
20
19
  "clean": "npm cache clean && npm run rimraf -- node_modules dist bundle",
@@ -25,7 +24,7 @@
25
24
  "gitdiff": "git diff --quiet && git diff --cached --quiet",
26
25
  "preversion": "npm run gitdiff && npm run eslint:commit || exit 0",
27
26
  "prebuild": "npm run clean:dist",
28
- "build": "npm run tsc:build && npm run rollup && npm run uglifyjs",
27
+ "build": "npm run tsc:build && npm run rollup",
29
28
  "copyVersionToIndex": "node ./copyVersionToIndex && git add ./index.ts && git commit -m \"update version number in index.ts\"",
30
29
  "version": "npm run copyVersionToIndex && npm run build",
31
30
  "postversion": "git push && git push --tags && npm publish"
@@ -51,6 +50,9 @@
51
50
  "@awayjs/view": "^0.6.0",
52
51
  "tslib": "^2.3.0"
53
52
  },
53
+ "dependencies": {
54
+ "node-html-parser": "^1.4.5"
55
+ },
54
56
  "devDependencies": {
55
57
  "@awayjs/core": "^0.9.0",
56
58
  "@awayjs/graphics": "^0.5.0",
@@ -58,17 +60,15 @@
58
60
  "@awayjs/renderer": "^0.11.0",
59
61
  "@awayjs/stage": "^0.11.0",
60
62
  "@awayjs/view": "^0.6.0",
63
+ "@rollup/plugin-commonjs": "^18.0.0",
64
+ "@rollup/plugin-terser": "^0.4.3",
65
+ "@rollup/plugin-node-resolve": "^11.2.1",
61
66
  "@typescript-eslint/eslint-plugin": "^4.4.1",
62
67
  "@typescript-eslint/parser": "^4.4.1",
63
68
  "eslint": "^7.11.0",
64
69
  "rimraf": "^2.5.2",
65
- "rollup": "^0.36.4",
66
- "rollup-plugin-includepaths": "^0.2.1",
70
+ "rollup": "^2.79.1",
67
71
  "tslib": "^2.3.0",
68
- "typescript": "^3.7.3",
69
- "uglify-js": "^3.0.15"
70
- },
71
- "dependencies": {
72
- "node-html-parser": "^1.4.5"
72
+ "typescript": "^4.9.5"
73
73
  }
74
74
  }
package/rollup.config.js CHANGED
@@ -1,33 +1,34 @@
1
- var includePaths = require('rollup-plugin-includepaths');
1
+ import nodeResolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import terser from '@rollup/plugin-terser';
2
4
 
3
- module.exports = {
4
- entry: './dist/index.js',
5
- sourceMap: true,
6
- format: 'umd',
7
- moduleName: 'AwayjsScene',
8
- external: [
9
- '@awayjs/core',
10
- '@awayjs/graphics',
11
- '@awayjs/stage',
12
- '@awayjs/view',
13
- '@awayjs/renderer',
14
- '@awayjs/materials'
15
- ],
16
- globals: {
17
- '@awayjs/core': 'AwayjsCore',
18
- '@awayjs/graphics': 'AwayjsGraphics',
19
- '@awayjs/stage': 'AwayjsStage',
20
- '@awayjs/view': 'AwayjsView',
21
- '@awayjs/renderer': 'AwayjsRenderer',
22
- '@awayjs/materials': 'AwayjsMaterials'
23
- },
24
- targets: [
25
- { dest: './bundle/awayjs-scene.umd.js'}
5
+ export default {
6
+ input: './dist/index.js',
7
+ output: {
8
+ name: 'AwayjsScene',
9
+ globals: {
10
+ '@awayjs/core': 'AwayjsCore',
11
+ '@awayjs/stage': 'AwayjsStage',
12
+ '@awayjs/view': 'AwayjsView',
13
+ '@awayjs/renderer': 'AwayjsRenderer',
14
+ '@awayjs/graphics': 'AwayjsGraphics',
15
+ '@awayjs/materials': 'AwayjsMaterials'
16
+ },
17
+ sourcemap: true,
18
+ format: 'umd',
19
+ file: './bundle/awayjs-scene.umd.js'
20
+ },
21
+ external: [
22
+ '@awayjs/core',
23
+ '@awayjs/stage',
24
+ '@awayjs/view',
25
+ '@awayjs/renderer',
26
+ '@awayjs/graphics',
27
+ '@awayjs/materials'
26
28
  ],
27
29
  plugins: [
28
- includePaths({
29
- include : {
30
- "tslib": "./node_modules/tslib/tslib.es6.js"
31
- }
32
- }) ]
30
+ nodeResolve(),
31
+ commonjs(),
32
+ terser(),
33
+ ]
33
34
  };