@awayjs/scene 0.13.300 → 0.13.301
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.
- package/bundle/awayjs-scene.umd.js +2 -2
- package/bundle/awayjs-scene.umd.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/Scene.d.ts +6 -5
- package/dist/lib/Scene.d.ts.map +1 -1
- package/dist/lib/Scene.js +13 -15
- package/dist/lib/display/Billboard.d.ts.map +1 -1
- package/dist/lib/display/Billboard.js +1 -2
- package/dist/lib/display/Camera.d.ts +1 -10
- package/dist/lib/display/Camera.d.ts.map +1 -1
- package/dist/lib/display/Camera.js +1 -19
- package/dist/lib/display/DisplayObject.d.ts +0 -6
- package/dist/lib/display/DisplayObject.d.ts.map +1 -1
- package/dist/lib/display/DisplayObject.js +3 -10
- package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
- package/dist/lib/display/DisplayObjectContainer.js +1 -2
- package/dist/lib/display/LineSegment.d.ts.map +1 -1
- package/dist/lib/display/LineSegment.js +1 -2
- package/dist/lib/display/MovieClip.d.ts.map +1 -1
- package/dist/lib/display/MovieClip.js +0 -2
- package/dist/lib/display/Skybox.d.ts +3 -3
- package/dist/lib/display/Skybox.d.ts.map +1 -1
- package/dist/lib/display/Skybox.js +3 -5
- package/dist/lib/display/Sprite.d.ts +0 -4
- package/dist/lib/display/Sprite.d.ts.map +1 -1
- package/dist/lib/display/Sprite.js +7 -19
- package/dist/lib/display/TextField.d.ts +0 -1
- package/dist/lib/display/TextField.d.ts.map +1 -1
- package/dist/lib/display/TextField.js +1 -46
- package/dist/lib/display/TextSprite.d.ts +2 -1
- package/dist/lib/display/TextSprite.d.ts.map +1 -1
- package/dist/lib/display/TextSprite.js +2 -2
- package/dist/lib/events/FocusEvent.d.ts +2 -2
- package/dist/lib/events/FocusEvent.d.ts.map +1 -1
- package/dist/lib/events/PointerEvent.d.ts +2 -2
- package/dist/lib/events/PointerEvent.d.ts.map +1 -1
- package/dist/lib/image/SceneImage2D.js +2 -2
- package/dist/lib/managers/MouseManager.d.ts +3 -3
- package/dist/lib/managers/MouseManager.d.ts.map +1 -1
- package/dist/lib/text/FNTGenerator.js +1 -1
- package/index.ts +1 -1
- package/lib/Scene.ts +18 -21
- package/lib/display/Billboard.ts +1 -4
- package/lib/display/Camera.ts +2 -16
- package/lib/display/DisplayObject.ts +3 -15
- package/lib/display/DisplayObjectContainer.ts +2 -3
- package/lib/display/LineSegment.ts +3 -4
- package/lib/display/MovieClip.ts +0 -4
- package/lib/display/Skybox.ts +5 -6
- package/lib/display/Sprite.ts +11 -24
- package/lib/display/TextField.ts +3 -53
- package/lib/display/TextSprite.ts +5 -3
- package/lib/events/FocusEvent.ts +1 -1
- package/lib/events/PointerEvent.ts +2 -2
- package/lib/image/SceneImage2D.ts +2 -2
- package/lib/managers/MouseManager.ts +14 -14
- package/lib/text/FNTGenerator.ts +1 -1
- package/package.json +1 -1
package/lib/display/TextField.ts
CHANGED
|
@@ -870,59 +870,6 @@ export class TextField extends DisplayObjectContainer {
|
|
|
870
870
|
public get internalScale(): Vector3D {
|
|
871
871
|
return this._internalScale;
|
|
872
872
|
}
|
|
873
|
-
// public getInternalScale(view:View = null):Vector3D
|
|
874
|
-
// {
|
|
875
|
-
// if(this.parent)
|
|
876
|
-
// this._internalScale.copyFrom(this.parent.transform.concatenatedMatrix3D.decompose()[3]);
|
|
877
|
-
// else
|
|
878
|
-
// this._internalScale.identity();
|
|
879
|
-
|
|
880
|
-
// if (view) {
|
|
881
|
-
// this._internalScale.x *= view.focalLength*view.pixelRatio/1000;
|
|
882
|
-
// this._internalScale.y *= view.focalLength/1000;
|
|
883
|
-
// }
|
|
884
|
-
|
|
885
|
-
// this._internalScale.x=1/this._internalScale.x;
|
|
886
|
-
// this._internalScale.y=1/this._internalScale.y;
|
|
887
|
-
// return this._internalScale;
|
|
888
|
-
// }
|
|
889
|
-
public _iInternalUpdate(): void {
|
|
890
|
-
super._iInternalUpdate();
|
|
891
|
-
|
|
892
|
-
//if (!this.inMaskMode) {
|
|
893
|
-
|
|
894
|
-
this.reConstruct(true);
|
|
895
|
-
|
|
896
|
-
/*if (this._textFormat
|
|
897
|
-
&& !this._textFormat.font_table.isAsset(TesselatedFontTable)
|
|
898
|
-
&& !this._textFormat.material) {
|
|
899
|
-
// only for FNT font-tables
|
|
900
|
-
// todo: do we still need this ?
|
|
901
|
-
|
|
902
|
-
this.transform.colorTransform || (this.transform.colorTransform = new ColorTransform());
|
|
903
|
-
this.transform.colorTransform.color = (this.textColor != null) ? this.textColor : this._textFormat.color;
|
|
904
|
-
this._invalidateHierarchicalProperties(HierarchicalProperties.COLOR_TRANSFORM);
|
|
905
|
-
}*/
|
|
906
|
-
//}
|
|
907
|
-
/*
|
|
908
|
-
if (projection) {
|
|
909
|
-
this._strokeScale.x = (<PerspectiveProjection> projection).hFocalLength/1000;
|
|
910
|
-
this._strokeScale.y = (<PerspectiveProjection> projection).focalLength/1000;
|
|
911
|
-
}else{
|
|
912
|
-
this._strokeScale.x = 1;
|
|
913
|
-
this._strokeScale.y = 1;
|
|
914
|
-
}
|
|
915
|
-
this._graphics.updateScale(projection);*/
|
|
916
|
-
|
|
917
|
-
//const prevScaleX: number = this._internalScale.x;
|
|
918
|
-
//const prevScaleY: number = this._internalScale.y;
|
|
919
|
-
// var scale:Vector3D = this.getInternalScale(view);
|
|
920
|
-
// if (scale.x == prevScaleX && scale.y == prevScaleY)
|
|
921
|
-
// return;
|
|
922
|
-
// this._internalScale=scale;
|
|
923
|
-
// this._glyphsDirty=true;
|
|
924
|
-
|
|
925
|
-
}
|
|
926
873
|
|
|
927
874
|
/**
|
|
928
875
|
*
|
|
@@ -1941,6 +1888,9 @@ export class TextField extends DisplayObjectContainer {
|
|
|
1941
1888
|
}
|
|
1942
1889
|
|
|
1943
1890
|
public getEntity(): IPartitionEntity {
|
|
1891
|
+
|
|
1892
|
+
this.reConstruct(true);
|
|
1893
|
+
|
|
1944
1894
|
return this._graphics;
|
|
1945
1895
|
}
|
|
1946
1896
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Sprite } from './Sprite';
|
|
2
2
|
import { TextField } from './TextField';
|
|
3
3
|
import { TesselatedFontTable } from '../text/TesselatedFontTable';
|
|
4
|
-
import { HierarchicalProperty } from '@awayjs/view';
|
|
4
|
+
import { HierarchicalProperty, IPartitionEntity } from '@awayjs/view';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* TextSprite is used for masked text.
|
|
@@ -10,8 +10,8 @@ import { HierarchicalProperty } from '@awayjs/view';
|
|
|
10
10
|
export class TextSprite extends Sprite {
|
|
11
11
|
public parentTextField: TextField;
|
|
12
12
|
|
|
13
|
-
public
|
|
14
|
-
|
|
13
|
+
public getEntity(): IPartitionEntity {
|
|
14
|
+
|
|
15
15
|
const tf: TextField = this.parentTextField;
|
|
16
16
|
//tf.reConstruct(true);
|
|
17
17
|
|
|
@@ -19,5 +19,7 @@ export class TextSprite extends Sprite {
|
|
|
19
19
|
this.transform.colorTransform.color = (tf.textColor != null) ? tf.textColor : tf._textFormats[0].color;
|
|
20
20
|
this._invalidateHierarchicalProperty(HierarchicalProperty.COLOR_TRANSFORM);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
return this._graphics;
|
|
22
24
|
}
|
|
23
25
|
}
|
package/lib/events/FocusEvent.ts
CHANGED
|
@@ -36,7 +36,7 @@ export class PointerEvent extends EventBase {
|
|
|
36
36
|
/**
|
|
37
37
|
* The entity of the picker inside which the event took place.
|
|
38
38
|
*/
|
|
39
|
-
public rootNode:
|
|
39
|
+
public rootNode: INode;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* The traversable owner inside which the event took place.
|
|
@@ -141,6 +141,6 @@ export class PointerEvent extends EventBase {
|
|
|
141
141
|
return sceneNormal;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
public _dispatchEvent(dispatcher:
|
|
144
|
+
public _dispatchEvent(dispatcher: INode, target: IPartitionContainer) {
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -191,7 +191,7 @@ export class SceneImage2D extends BitmapImage2D {
|
|
|
191
191
|
SceneImage2D._rootNode = SceneImage2D._view.getNode(SceneImage2D._root);
|
|
192
192
|
SceneImage2D._renderer = <DefaultRenderer> RenderGroup
|
|
193
193
|
.getInstance(DefaultRenderer)
|
|
194
|
-
.getRenderer(SceneImage2D._rootNode
|
|
194
|
+
.getRenderer(SceneImage2D._rootNode);
|
|
195
195
|
|
|
196
196
|
//set the view properties
|
|
197
197
|
SceneImage2D._view.backgroundAlpha = 0;
|
|
@@ -218,7 +218,7 @@ export class SceneImage2D extends BitmapImage2D {
|
|
|
218
218
|
SceneImage2D._billboardRoot = new DisplayObjectContainer();
|
|
219
219
|
SceneImage2D._billboardRenderer = <DefaultRenderer> RenderGroup
|
|
220
220
|
.getInstance(DefaultRenderer)
|
|
221
|
-
.getRenderer(SceneImage2D._billboardView.getNode(SceneImage2D._billboardRoot)
|
|
221
|
+
.getRenderer(SceneImage2D._billboardView.getNode(SceneImage2D._billboardRoot));
|
|
222
222
|
|
|
223
223
|
//SceneImage2D._billboardRoot.partition = SceneImage2D._billboardRenderer.partition;
|
|
224
224
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3D } from '@awayjs/core';
|
|
2
2
|
import { Stage } from '@awayjs/stage';
|
|
3
3
|
|
|
4
|
-
import { PickingCollision, RaycastPicker,
|
|
4
|
+
import { PickingCollision, RaycastPicker, INode } from '@awayjs/view';
|
|
5
5
|
import { FocusEvent } from '../events/FocusEvent';
|
|
6
6
|
|
|
7
7
|
import { KeyboardEvent } from '../events/KeyboardEvent';
|
|
@@ -27,7 +27,7 @@ export class MouseManager {
|
|
|
27
27
|
|
|
28
28
|
private _updateDirty: boolean;
|
|
29
29
|
|
|
30
|
-
private _focusNode:
|
|
30
|
+
private _focusNode: INode; // entity currently in focus
|
|
31
31
|
|
|
32
32
|
public allowKeyInput: boolean=true;
|
|
33
33
|
|
|
@@ -216,7 +216,7 @@ export class MouseManager {
|
|
|
216
216
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
public setFocus(node:
|
|
219
|
+
public setFocus(node: INode) {
|
|
220
220
|
if (this._focusNode == node)
|
|
221
221
|
return;
|
|
222
222
|
|
|
@@ -241,7 +241,7 @@ export class MouseManager {
|
|
|
241
241
|
return this._focusNode;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
private dispatchEvent(event: PointerEvent | FocusEvent, dispatcher:
|
|
244
|
+
private dispatchEvent(event: PointerEvent | FocusEvent, dispatcher: INode) {
|
|
245
245
|
if (!this._eventBubbling) {
|
|
246
246
|
if (dispatcher) {
|
|
247
247
|
event._dispatchEvent(dispatcher, dispatcher.container);
|
|
@@ -266,7 +266,7 @@ export class MouseManager {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
private setupAndDispatchEvent(event: PointerEvent, pointerData: PointerData,
|
|
269
|
-
collision: PickingCollision, commonAncestor:
|
|
269
|
+
collision: PickingCollision, commonAncestor: INode = null) {
|
|
270
270
|
|
|
271
271
|
const sourceEvent = pointerData.sourceEvent;
|
|
272
272
|
if (sourceEvent) {
|
|
@@ -305,7 +305,7 @@ export class MouseManager {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
let event: PointerEvent;
|
|
308
|
-
let dispatcher:
|
|
308
|
+
let dispatcher: INode;
|
|
309
309
|
|
|
310
310
|
const len = pointerData.queuedEvents.length;
|
|
311
311
|
for (let i = 0; i < len; ++i) {
|
|
@@ -348,8 +348,8 @@ export class MouseManager {
|
|
|
348
348
|
// @todo: at this point the object under the mouse might have been changed,
|
|
349
349
|
// so we need to recheck the collision ?
|
|
350
350
|
|
|
351
|
-
let upContainerNode:
|
|
352
|
-
let upRootNode:
|
|
351
|
+
let upContainerNode: INode = null;
|
|
352
|
+
let upRootNode: INode = null;
|
|
353
353
|
if (this._isAVM1Dragging && pointerData.dragCollision) {
|
|
354
354
|
// avm1dragging is in process, dispatch the mouse-up on this.
|
|
355
355
|
// mouseDragEntity instead of the current collision
|
|
@@ -415,8 +415,8 @@ export class MouseManager {
|
|
|
415
415
|
pointerData.rollOut.commonAncestor = null;
|
|
416
416
|
pointerData.rollOver.commonAncestor = null;
|
|
417
417
|
|
|
418
|
-
const collisionNode:
|
|
419
|
-
const prevCollisionNode:
|
|
418
|
+
const collisionNode: INode = collision?.rootNode;
|
|
419
|
+
const prevCollisionNode: INode = pointerData.prevCollision?.rootNode;
|
|
420
420
|
|
|
421
421
|
if (collisionNode != prevCollisionNode) {
|
|
422
422
|
|
|
@@ -446,13 +446,13 @@ export class MouseManager {
|
|
|
446
446
|
}
|
|
447
447
|
if (prevCollisionNode && collisionNode) {
|
|
448
448
|
// rollout / rollover find common ancester and only bubble up to that point
|
|
449
|
-
const parentsPrev:
|
|
450
|
-
let parent:
|
|
449
|
+
const parentsPrev: INode[] = [];
|
|
450
|
+
let parent: INode = prevCollisionNode;
|
|
451
451
|
while (parent && !parent.container.isAVMScene) {
|
|
452
452
|
parentsPrev.push(parent);
|
|
453
453
|
parent = parent.parent;
|
|
454
454
|
}
|
|
455
|
-
let commonAncestor:
|
|
455
|
+
let commonAncestor: INode = null;
|
|
456
456
|
parent = collisionNode;
|
|
457
457
|
while (parent && !parent.container.isAVMScene) {
|
|
458
458
|
const oldParentIdx = parentsPrev.indexOf(parent);
|
|
@@ -664,7 +664,7 @@ export class MouseManager {
|
|
|
664
664
|
// Private.
|
|
665
665
|
// ---------------------------------------------------------------------
|
|
666
666
|
private setUpEvent(event: PointerEvent, pointerData: PointerData,
|
|
667
|
-
collision: PickingCollision, commonAncestor:
|
|
667
|
+
collision: PickingCollision, commonAncestor: INode = null): PointerEvent {
|
|
668
668
|
event._iAllowedToImmediatlyPropagate = true;
|
|
669
669
|
event._iAllowedToPropagate = true;
|
|
670
670
|
// 2D properties.
|
package/lib/text/FNTGenerator.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class FNTGenerator extends FNTGeneratorBase {
|
|
|
34
34
|
this._root = new DisplayObjectContainer();
|
|
35
35
|
this._renderer = <DefaultRenderer> RenderGroup
|
|
36
36
|
.getInstance(DefaultRenderer)
|
|
37
|
-
.getRenderer(this._view.getNode(this._root)
|
|
37
|
+
.getRenderer(this._view.getNode(this._root));
|
|
38
38
|
|
|
39
39
|
//set the view properties
|
|
40
40
|
this._renderer.view.projection = projection;
|