@awayjs/scene 0.13.223 → 0.13.232
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 +879 -417
- package/bundle/awayjs-scene.umd.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/Settings.d.ts +3 -0
- package/dist/lib/Settings.d.ts.map +1 -1
- package/dist/lib/Settings.js +14 -0
- package/dist/lib/display/DisplayObjectContainer.d.ts +1 -0
- package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
- package/dist/lib/display/DisplayObjectContainer.js +4 -2
- package/dist/lib/display/TextField.d.ts +36 -5
- package/dist/lib/display/TextField.d.ts.map +1 -1
- package/dist/lib/display/TextField.js +227 -138
- package/dist/lib/image/SceneImage2D.d.ts.map +1 -1
- package/dist/lib/image/SceneImage2D.js +35 -8
- package/dist/lib/managers/MouseManager.d.ts +1 -1
- package/dist/lib/managers/MouseManager.d.ts.map +1 -1
- package/dist/lib/managers/MouseManager.js +9 -29
- package/dist/lib/text/FNTGenerator.d.ts +5 -4
- package/dist/lib/text/FNTGenerator.d.ts.map +1 -1
- package/dist/lib/text/FNTGenerator.js +15 -11
- package/dist/lib/text/FNTGeneratorCanvas.d.ts +23 -0
- package/dist/lib/text/FNTGeneratorCanvas.d.ts.map +1 -0
- package/dist/lib/text/FNTGeneratorCanvas.js +205 -0
- package/dist/lib/text/FNTGeneratrorBase.d.ts +8 -0
- package/dist/lib/text/FNTGeneratrorBase.d.ts.map +1 -0
- package/dist/lib/text/FNTGeneratrorBase.js +7 -0
- package/dist/lib/text/TesselatedFontChar.d.ts +6 -4
- package/dist/lib/text/TesselatedFontChar.d.ts.map +1 -1
- package/dist/lib/text/TesselatedFontChar.js +8 -3
- package/dist/lib/text/TesselatedFontTable.d.ts +19 -3
- package/dist/lib/text/TesselatedFontTable.d.ts.map +1 -1
- package/dist/lib/text/TesselatedFontTable.js +339 -225
- package/dist/lib/text/TextShape.d.ts +6 -3
- package/dist/lib/text/TextShape.d.ts.map +1 -1
- package/dist/lib/text/TextShape.js +27 -2
- package/index.ts +1 -1
- package/lib/Settings.ts +20 -1
- package/lib/display/DisplayObjectContainer.ts +4 -2
- package/lib/display/TextField.ts +317 -145
- package/lib/image/SceneImage2D.ts +84 -9
- package/lib/managers/MouseManager.ts +11 -30
- package/lib/text/FNTGenerator.ts +5 -7
- package/lib/text/FNTGeneratorCanvas.ts +288 -0
- package/lib/text/FNTGeneratrorBase.ts +11 -0
- package/lib/text/TesselatedFontChar.ts +8 -12
- package/lib/text/TesselatedFontTable.ts +438 -255
- package/lib/text/TextShape.ts +30 -3
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
|
|
|
5
5
|
import { DisplayObject } from '../display/DisplayObject';
|
|
6
6
|
import { Billboard } from '../display/Billboard';
|
|
7
7
|
import { Settings } from '../Settings';
|
|
8
|
-
import { Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform, ColorUtils } from '@awayjs/core';
|
|
8
|
+
import { Rectangle, Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform, ColorUtils } from '@awayjs/core';
|
|
9
9
|
import { Stage, BitmapImage2D, _Stage_BitmapImage2D, BlendMode } from '@awayjs/stage';
|
|
10
10
|
import { DefaultRenderer, RenderGroup, Style } from '@awayjs/renderer';
|
|
11
11
|
// empty matrix for transform reset
|
|
@@ -217,6 +217,7 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
217
217
|
//setup the projection
|
|
218
218
|
SceneImage2D._renderer.disableClear = true;
|
|
219
219
|
SceneImage2D._renderer.view.backgroundAlpha = 0;
|
|
220
|
+
SceneImage2D._renderer.view.backgroundColor = 0x0;
|
|
220
221
|
SceneImage2D._renderer.view.projection = projection;
|
|
221
222
|
SceneImage2D._renderer.view.projection.transform = new Transform();
|
|
222
223
|
SceneImage2D._renderer.view.projection.transform.scaleTo(1, -1, 1);
|
|
@@ -239,6 +240,7 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
239
240
|
//setup the projection
|
|
240
241
|
SceneImage2D._billboardRenderer.disableClear = true;
|
|
241
242
|
SceneImage2D._billboardRenderer.view.backgroundAlpha = 0;
|
|
243
|
+
SceneImage2D._billboardRenderer.view.backgroundColor = 0x0;
|
|
242
244
|
SceneImage2D._billboardRenderer.view.projection = projection;
|
|
243
245
|
SceneImage2D._billboardRenderer.view.projection.transform = new Transform();
|
|
244
246
|
SceneImage2D._billboardRenderer.view.projection.transform.moveTo(0, 0, -1000);
|
|
@@ -395,7 +397,18 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
395
397
|
this.fillRect(this._rect, this._initalFillColor);
|
|
396
398
|
this._initalFillColor = null;
|
|
397
399
|
}
|
|
398
|
-
|
|
400
|
+
var compositeSource = source;
|
|
401
|
+
// merge alpha with source
|
|
402
|
+
if (alphaBitmapData) {
|
|
403
|
+
compositeSource = this._stage.filterManager.popTemp(source.width, source.height);
|
|
404
|
+
//this._stage.filterManager.copyPixels(source, compositeSource, source.rect, source.rect.topLeft);
|
|
405
|
+
this._stage.filterManager.copyPixels(alphaBitmapData, compositeSource, new Rectangle(alphaPoint.x, alphaPoint.y, sourceRect.width, sourceRect.height), new Point(0, 0));
|
|
406
|
+
this._stage.filterManager.copyPixels(source, compositeSource, source.rect, new Point(0, 0), true, 'alpha_back');
|
|
407
|
+
}
|
|
408
|
+
this._stage.filterManager.copyPixels(compositeSource, this, sourceRect, destPoint, mergeAlpha);
|
|
409
|
+
if (alphaBitmapData) {
|
|
410
|
+
this._stage.filterManager.pushTemp(compositeSource);
|
|
411
|
+
}
|
|
399
412
|
this._imageDataDirty = true;
|
|
400
413
|
};
|
|
401
414
|
SceneImage2D.prototype.threshold = function (source, sourceRect, destPoint, operation, threshold, color, mask, copySource) {
|
|
@@ -515,16 +528,23 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
515
528
|
this.fillRect(this._rect, this._initalFillColor);
|
|
516
529
|
this._initalFillColor = null;
|
|
517
530
|
}
|
|
531
|
+
var stage = this._stage;
|
|
532
|
+
var mappedBlend = SceneImage2D._mapSupportedBlendMode(blendMode);
|
|
533
|
+
var supportNativeBlend = !blendMode || mappedBlend !== BlendMode.LAYER || blendMode == BlendMode.LAYER;
|
|
534
|
+
var useTmp = (!supportNativeBlend || this === source);
|
|
535
|
+
var target = useTmp ?
|
|
536
|
+
stage.filterManager.popTemp(this.width, this.height, false)
|
|
537
|
+
: this;
|
|
518
538
|
var renderer = SceneImage2D._billboardRenderer;
|
|
519
539
|
var root = SceneImage2D._billboardRoot;
|
|
520
540
|
var billboard = SceneImage2D._billboard;
|
|
521
541
|
billboard.sampler.smooth = smoothing;
|
|
522
|
-
renderer.disableClear =
|
|
523
|
-
renderer.view.target =
|
|
524
|
-
renderer.view.projection.scale = 1000 /
|
|
542
|
+
renderer.disableClear = !useTmp;
|
|
543
|
+
renderer.view.target = target;
|
|
544
|
+
renderer.view.projection.scale = 1000 / target.height;
|
|
525
545
|
billboard.material.style.image = source;
|
|
526
546
|
// not all blend modes can be used for rendering
|
|
527
|
-
billboard.material.blendMode = SceneImage2D._mapSupportedBlendMode(blendMode);
|
|
547
|
+
billboard.material.blendMode = !useTmp ? SceneImage2D._mapSupportedBlendMode(blendMode) : BlendMode.LAYER;
|
|
528
548
|
billboard.material.useColorTransform = !!colorTransform;
|
|
529
549
|
if (matrix) {
|
|
530
550
|
var m = root.transform.matrix3D;
|
|
@@ -534,17 +554,22 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
534
554
|
m._rawData[4] = matrix.c;
|
|
535
555
|
m._rawData[5] = -matrix.d;
|
|
536
556
|
m._rawData[12] = matrix.tx;
|
|
537
|
-
m._rawData[13] =
|
|
557
|
+
m._rawData[13] = target.height - matrix.ty;
|
|
538
558
|
root.transform.invalidateComponents();
|
|
539
559
|
}
|
|
540
560
|
else {
|
|
541
561
|
root.transform.rotateTo(0, 0, 0);
|
|
542
562
|
root.transform.scaleTo(1, -1, 1);
|
|
543
|
-
root.transform.moveTo(0,
|
|
563
|
+
root.transform.moveTo(0, target.height, 0);
|
|
544
564
|
}
|
|
545
565
|
root.transform.colorTransform = colorTransform;
|
|
546
566
|
//render
|
|
547
567
|
renderer.render();
|
|
568
|
+
//
|
|
569
|
+
if (useTmp) {
|
|
570
|
+
stage.filterManager.copyPixels(target, this, this.rect, TMP_POINT, true, blendMode);
|
|
571
|
+
stage.filterManager.pushTemp(target);
|
|
572
|
+
}
|
|
548
573
|
};
|
|
549
574
|
SceneImage2D.prototype._drawAsDisplay = function (source, matrix, colorTransform, blendMode, _clipRect, _smoothing) {
|
|
550
575
|
if (blendMode === void 0) { blendMode = ''; }
|
|
@@ -623,6 +648,8 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
623
648
|
renderer.view.height = this.height;
|
|
624
649
|
var sourceNode = rootNode.addChildAt(source, 0);
|
|
625
650
|
sourceNode.transformDisabled = true;
|
|
651
|
+
// color transform should be enabled!
|
|
652
|
+
sourceNode.colorTransformDisabled = false;
|
|
626
653
|
root.transform.colorTransform = colorTransform;
|
|
627
654
|
// anyway we not support this =))
|
|
628
655
|
root.blendMode = SceneImage2D._mapSupportedBlendMode(blendMode);
|
|
@@ -45,7 +45,7 @@ export declare class MouseManager {
|
|
|
45
45
|
buttonEnabledDirty: boolean;
|
|
46
46
|
private _isTouch;
|
|
47
47
|
private _isAVM1Dragging;
|
|
48
|
-
startDragObject(collision
|
|
48
|
+
startDragObject(collision?: PickingCollision): void;
|
|
49
49
|
stopDragObject(): void;
|
|
50
50
|
get showCursor(): boolean;
|
|
51
51
|
set showCursor(value: boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MouseManager.d.ts","sourceRoot":"","sources":["../../../lib/managers/MouseManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,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QAAQ;IAIf,OAAO,CAAC,aAAa;IAyBrB,OAAO,CAAC,qBAAqB;IActB,eAAe,CAAC,WAAW,GAAE,aAAoB,GAAG,IAAI;IAoPxD,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAI3C,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAI7C,uBAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,GAAE,MAAU,GAAG,IAAI;IAyF9E,4BAA4B,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,GAAE,MAAU,GAAG,IAAI;IA4DtF,OAAO,CAAC,UAAU;IAuClB,OAAO,CAAC,aAAa;IAed,SAAS,CAAC,KAAK,KAAA,GAAG,IAAI;IAsBtB,OAAO,CAAC,KAAK,KAAA,GAAG,IAAI;IAuBpB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IASjD,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOnC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOpC,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMhC,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAY7C,OAAO,CAAC,OAAO,CAAkB;IAE1B,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IA0BjD,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAwB/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAO5C,OAAO,CAAC,eAAe;CAKvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3D } from '@awayjs/core';
|
|
2
2
|
import { KeyboardEvent } from '../events/KeyboardEvent';
|
|
3
3
|
import { MouseEvent as AwayMouseEvent } from '../events/MouseEvent';
|
|
4
|
-
import { FrameScriptManager } from '
|
|
4
|
+
import { FrameScriptManager } from './FrameScriptManager';
|
|
5
5
|
/**
|
|
6
6
|
* MouseManager enforces a singleton pattern and is not intended to be instanced.
|
|
7
7
|
* it provides a manager class for detecting mouse hits on scene objects and sending out mouse events.
|
|
@@ -74,7 +74,8 @@ var MouseManager = /** @class */ (function () {
|
|
|
74
74
|
}
|
|
75
75
|
MouseManager.prototype.startDragObject = function (collision) {
|
|
76
76
|
this._isAVM1Dragging = true;
|
|
77
|
-
if
|
|
77
|
+
// we MUST overrider collision target if present, because draggable !== drag emitter
|
|
78
|
+
if (collision)
|
|
78
79
|
this._mouseDragCollision = collision;
|
|
79
80
|
};
|
|
80
81
|
MouseManager.prototype.stopDragObject = function () {
|
|
@@ -229,7 +230,7 @@ var MouseManager = /** @class */ (function () {
|
|
|
229
230
|
};
|
|
230
231
|
MouseManager.prototype.fireMouseEvents = function (forcePicker) {
|
|
231
232
|
if (forcePicker === void 0) { forcePicker = null; }
|
|
232
|
-
var _a, _b, _c, _d, _e;
|
|
233
|
+
var _a, _b, _c, _d, _e, _f;
|
|
233
234
|
var collision;
|
|
234
235
|
if (forcePicker) {
|
|
235
236
|
collision = forcePicker.getViewCollision(this._stage.screenX, this._stage.screenY);
|
|
@@ -245,12 +246,6 @@ var MouseManager = /** @class */ (function () {
|
|
|
245
246
|
var event;
|
|
246
247
|
var dispatcher;
|
|
247
248
|
var len = this._queuedEvents.length;
|
|
248
|
-
// Dispatch all queued events.
|
|
249
|
-
/*var logEvents="";
|
|
250
|
-
for (var i: number = 0; i < len; ++i) {
|
|
251
|
-
logEvents+= " / "+this._queuedEvents[i].type;
|
|
252
|
-
}
|
|
253
|
-
console.log(logEvents);*/
|
|
254
249
|
for (var i = 0; i < len; ++i) {
|
|
255
250
|
event = this._queuedEvents[i];
|
|
256
251
|
dispatcher = (_a = collision) === null || _a === void 0 ? void 0 : _a.rootNode;
|
|
@@ -277,7 +272,7 @@ var MouseManager = /** @class */ (function () {
|
|
|
277
272
|
if (this._allowFocusOnUnfocusable || ((_b = this._mouseDragCollision) === null || _b === void 0 ? void 0 : _b.rootNode.container.tabEnabled)) {
|
|
278
273
|
if (this._focusContainer)
|
|
279
274
|
this._focusContainer.setFocus(false, true);
|
|
280
|
-
this._focusContainer = (_c = this._mouseDragCollision) === null || _c === void 0 ? void 0 : _c.rootNode.container;
|
|
275
|
+
this._focusContainer = (_d = (_c = this._mouseDragCollision) === null || _c === void 0 ? void 0 : _c.rootNode) === null || _d === void 0 ? void 0 : _d.container;
|
|
281
276
|
if (this._focusContainer)
|
|
282
277
|
this._focusContainer.setFocus(true, true);
|
|
283
278
|
}
|
|
@@ -360,8 +355,8 @@ var MouseManager = /** @class */ (function () {
|
|
|
360
355
|
this._queuedEvents.length = 0;
|
|
361
356
|
this._rollOut.commonAncestor = null;
|
|
362
357
|
this._rollOver.commonAncestor = null;
|
|
363
|
-
var collisionNode = (
|
|
364
|
-
var prevCollisionNode = (
|
|
358
|
+
var collisionNode = (_e = collision) === null || _e === void 0 ? void 0 : _e.rootNode;
|
|
359
|
+
var prevCollisionNode = (_f = this._prevCollision) === null || _f === void 0 ? void 0 : _f.rootNode;
|
|
365
360
|
if (collisionNode != prevCollisionNode) {
|
|
366
361
|
// If colliding object has changed, queue OVER and OUT events.
|
|
367
362
|
// If the mouse is dragged (mouse-down is hold), use DRAG_OVER and DRAG_OUT instead of MOUSE_OVER MOUSE_OUT
|
|
@@ -433,27 +428,12 @@ var MouseManager = /** @class */ (function () {
|
|
|
433
428
|
}
|
|
434
429
|
this._collisionIsEnabledButton = isActiveButton;
|
|
435
430
|
}
|
|
436
|
-
// set cursor if not dragging mouse
|
|
431
|
+
// set cursor if not dragging mouse ???
|
|
437
432
|
if (!this._mouseDragging) {
|
|
438
433
|
this.cursorType = collisionNode ? collisionNode.container.getMouseCursor() : 'auto';
|
|
439
434
|
}
|
|
440
435
|
this._updateDirty = false;
|
|
441
436
|
};
|
|
442
|
-
// public addSceneLayer(scene:Scene)
|
|
443
|
-
// {
|
|
444
|
-
// var stg:Stage = scene.stage;
|
|
445
|
-
//
|
|
446
|
-
// // Add instance to mouse3dmanager to fire mouse events for multiple scenes
|
|
447
|
-
// if (!scene.stageGL.mouse3DManager)
|
|
448
|
-
// scene.stageGL.mouse3DManager = this;
|
|
449
|
-
//
|
|
450
|
-
// if (!hasKey(scene))
|
|
451
|
-
// _scene3Ds[scene] = 0;
|
|
452
|
-
//
|
|
453
|
-
// _childDepth = 0;
|
|
454
|
-
// traverseDisplayObjects(stg);
|
|
455
|
-
// _sceneCount = _childDepth;
|
|
456
|
-
// }
|
|
457
437
|
MouseManager.prototype.registerPicker = function (picker) {
|
|
458
438
|
this._pickerLookup.push(picker);
|
|
459
439
|
};
|
|
@@ -650,7 +630,7 @@ var MouseManager = /** @class */ (function () {
|
|
|
650
630
|
};
|
|
651
631
|
MouseManager.prototype.queueDispatch = function (event, sourceEvent) {
|
|
652
632
|
// Store event to be dispatched later.
|
|
653
|
-
event.delta = (sourceEvent instanceof WheelEvent) ? sourceEvent.deltaY : 0;
|
|
633
|
+
event.delta = (sourceEvent instanceof WheelEvent) ? -3 * sourceEvent.deltaY / 100 : 0;
|
|
654
634
|
event.ctrlKey = sourceEvent.ctrlKey;
|
|
655
635
|
event.altKey = sourceEvent.altKey;
|
|
656
636
|
event.shiftKey = sourceEvent.shiftKey;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Font } from './Font';
|
|
2
|
-
|
|
2
|
+
import { Stage, BitmapImage2D } from '@awayjs/stage';
|
|
3
|
+
import { FNTGeneratorBase } from './FNTGeneratrorBase';
|
|
4
|
+
export declare class FNTGenerator extends FNTGeneratorBase {
|
|
3
5
|
private _root;
|
|
4
6
|
private _renderer;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
generate(font: Font, maxSize: number, fontSize: number, padding: number): any;
|
|
7
|
+
constructor(stage: Stage);
|
|
8
|
+
generate(font: Font, maxSize: number, fontSize: number, padding: number): BitmapImage2D[];
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=FNTGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FNTGenerator.d.ts","sourceRoot":"","sources":["../../../lib/text/FNTGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"FNTGenerator.d.ts","sourceRoot":"","sources":["../../../lib/text/FNTGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,qBAAa,YAAa,SAAQ,gBAAgB;IACjD,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,SAAS,CAAkB;gBAEvB,KAAK,EAAE,KAAK;IAwBjB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE;CAuDhG"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
1
2
|
import { PerspectiveProjection, CoordinateSystem, Transform, Vector3D } from '@awayjs/core';
|
|
2
3
|
import { BitmapImage2D } from '@awayjs/stage';
|
|
3
4
|
import { DefaultRenderer, RenderGroup } from '@awayjs/renderer';
|
|
4
5
|
import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
|
|
5
6
|
import { BasicPartition, NodePool, View } from '@awayjs/view';
|
|
6
7
|
import { Sprite } from '../display/Sprite';
|
|
7
|
-
|
|
8
|
+
import { FNTGeneratorBase } from './FNTGeneratrorBase';
|
|
9
|
+
var FNTGenerator = /** @class */ (function (_super) {
|
|
10
|
+
__extends(FNTGenerator, _super);
|
|
8
11
|
function FNTGenerator(stage) {
|
|
9
|
-
|
|
12
|
+
var _this = _super.call(this, stage) || this;
|
|
10
13
|
//create the projection
|
|
11
14
|
var projection = new PerspectiveProjection();
|
|
12
15
|
projection.coordinateSystem = CoordinateSystem.RIGHT_HANDED;
|
|
13
16
|
projection.originX = -1;
|
|
14
17
|
projection.originY = 1;
|
|
15
18
|
//create the view
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
_this._root = new DisplayObjectContainer();
|
|
20
|
+
_this._renderer = RenderGroup
|
|
18
21
|
.getInstance(new View(projection, stage, null, null, null, true), DefaultRenderer)
|
|
19
|
-
.getRenderer(NodePool.getRootNode(
|
|
22
|
+
.getRenderer(NodePool.getRootNode(_this._root, BasicPartition).partition);
|
|
20
23
|
//setup the projection
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
_this._renderer.view.projection = projection;
|
|
25
|
+
_this._renderer.view.projection.transform = new Transform();
|
|
26
|
+
_this._renderer.view.projection.transform.moveTo(0, 0, -1000);
|
|
27
|
+
_this._renderer.view.projection.transform.lookAt(new Vector3D());
|
|
28
|
+
_this._renderer.renderableSorter = null; //new RenderableSort2D();
|
|
29
|
+
return _this;
|
|
26
30
|
}
|
|
27
31
|
FNTGenerator.prototype.generate = function (font, maxSize, fontSize, padding) {
|
|
28
32
|
var outputBitmap;
|
|
@@ -64,5 +68,5 @@ var FNTGenerator = /** @class */ (function () {
|
|
|
64
68
|
return outputBitmaps;
|
|
65
69
|
};
|
|
66
70
|
return FNTGenerator;
|
|
67
|
-
}());
|
|
71
|
+
}(FNTGeneratorBase));
|
|
68
72
|
export { FNTGenerator };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FNTGeneratorBase } from './FNTGeneratrorBase';
|
|
2
|
+
import { Font } from './Font';
|
|
3
|
+
import { BitmapImage2D, Stage } from '@awayjs/stage';
|
|
4
|
+
export declare class FNTGeneratorCanvas extends FNTGeneratorBase {
|
|
5
|
+
private static getCanvasContext;
|
|
6
|
+
private static freeCanvasContext;
|
|
7
|
+
private static transformChar;
|
|
8
|
+
private static sortPatches;
|
|
9
|
+
private static render;
|
|
10
|
+
/**
|
|
11
|
+
* Debug mode.
|
|
12
|
+
* Prevent OffscreenCanvas and prevent canvas clear.
|
|
13
|
+
* Store canvas
|
|
14
|
+
*/
|
|
15
|
+
debug: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Store canvas used for caching. Only in debug mode
|
|
18
|
+
*/
|
|
19
|
+
canvas: HTMLCanvasElement;
|
|
20
|
+
constructor(stage: Stage, debug?: boolean);
|
|
21
|
+
generate(font: Font, size: number, fontSize: number, padding: number): BitmapImage2D[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=FNTGeneratorCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FNTGeneratorCanvas.d.ts","sourceRoot":"","sources":["../../../lib/text/FNTGeneratorCanvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAqCrD,qBAAa,kBAAmB,SAAQ,gBAAgB;IACvD,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAe/B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,OAAO,CAAC,MAAM,CAAC,aAAa;IA+D5B,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,MAAM,CAAC,MAAM;IAyGrB;;;;OAIG;IACI,KAAK,EAAE,OAAO,CAAS;IAE9B;;OAEG;IACI,MAAM,EAAE,iBAAiB,CAAC;gBAErB,KAAK,EAAE,KAAK,EAAE,KAAK,UAAQ;IAMhC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE;CAgC7F"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { FNTGeneratorBase } from './FNTGeneratrorBase';
|
|
3
|
+
import { BitmapImage2D } from '@awayjs/stage';
|
|
4
|
+
import { Rectangle } from '@awayjs/core';
|
|
5
|
+
import { GraphicsPathCommand } from '@awayjs/graphics';
|
|
6
|
+
var Bounds = /** @class */ (function () {
|
|
7
|
+
function Bounds() {
|
|
8
|
+
this.left = Number.MAX_VALUE;
|
|
9
|
+
this.right = Number.MIN_VALUE;
|
|
10
|
+
this.top = Number.MAX_VALUE;
|
|
11
|
+
this.bottom = Number.MIN_VALUE;
|
|
12
|
+
}
|
|
13
|
+
Bounds.prototype.grown = function (x, y) {
|
|
14
|
+
if (x < this.left)
|
|
15
|
+
this.left = x;
|
|
16
|
+
if (x > this.right)
|
|
17
|
+
this.right = x;
|
|
18
|
+
if (y < this.top)
|
|
19
|
+
this.top = y;
|
|
20
|
+
if (y > this.bottom)
|
|
21
|
+
this.bottom = y;
|
|
22
|
+
};
|
|
23
|
+
Bounds.prototype.toRect = function () {
|
|
24
|
+
return new Rectangle(this.left, this.top, this.right - this.left, this.bottom - this.top);
|
|
25
|
+
};
|
|
26
|
+
return Bounds;
|
|
27
|
+
}());
|
|
28
|
+
var FNTGeneratorCanvas = /** @class */ (function (_super) {
|
|
29
|
+
__extends(FNTGeneratorCanvas, _super);
|
|
30
|
+
function FNTGeneratorCanvas(stage, debug) {
|
|
31
|
+
if (debug === void 0) { debug = false; }
|
|
32
|
+
var _this = _super.call(this, stage) || this;
|
|
33
|
+
/**
|
|
34
|
+
* Debug mode.
|
|
35
|
+
* Prevent OffscreenCanvas and prevent canvas clear.
|
|
36
|
+
* Store canvas
|
|
37
|
+
*/
|
|
38
|
+
_this.debug = false;
|
|
39
|
+
_this.debug = debug;
|
|
40
|
+
return _this;
|
|
41
|
+
}
|
|
42
|
+
FNTGeneratorCanvas.getCanvasContext = function (width, height, debug) {
|
|
43
|
+
if (width === void 0) { width = 100; }
|
|
44
|
+
if (height === void 0) { height = 100; }
|
|
45
|
+
if (debug === void 0) { debug = false; }
|
|
46
|
+
var canvas = ('OffscreenCanvas' in self && !debug)
|
|
47
|
+
? new self.OffscreenCanvas(width, height)
|
|
48
|
+
: document.createElement('canvas');
|
|
49
|
+
canvas.width = width;
|
|
50
|
+
canvas.height = height;
|
|
51
|
+
return canvas.getContext('2d', { desynchronized: true, alpha: true });
|
|
52
|
+
};
|
|
53
|
+
FNTGeneratorCanvas.freeCanvasContext = function (ctx) {
|
|
54
|
+
if (ctx.canvas instanceof self.OffscreenCanvas) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// safari bug with canvas leaks
|
|
58
|
+
ctx.canvas.width = 0;
|
|
59
|
+
ctx.canvas.height = 0;
|
|
60
|
+
};
|
|
61
|
+
FNTGeneratorCanvas.transformChar = function (char) {
|
|
62
|
+
var fillData = char.fill_data_path;
|
|
63
|
+
// empty command
|
|
64
|
+
if (fillData.commands[0].length === 0 && fillData.commands.length === 1) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
var path = new Path2D();
|
|
68
|
+
var box = new Bounds();
|
|
69
|
+
for (var i = 0; i < fillData.commands.length; i++) {
|
|
70
|
+
var data = fillData.data[i];
|
|
71
|
+
var commands = fillData.commands[i];
|
|
72
|
+
var pointer = 0;
|
|
73
|
+
for (var _i = 0, commands_1 = commands; _i < commands_1.length; _i++) {
|
|
74
|
+
var command = commands_1[_i];
|
|
75
|
+
switch (command) {
|
|
76
|
+
case GraphicsPathCommand.MOVE_TO: {
|
|
77
|
+
// flash path in twips, transform it
|
|
78
|
+
var px = data[pointer++] / 20;
|
|
79
|
+
var py = data[pointer++] / 20;
|
|
80
|
+
box.grown(px, py);
|
|
81
|
+
path.moveTo(px, py);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case GraphicsPathCommand.LINE_TO: {
|
|
85
|
+
var px = data[pointer++] / 20;
|
|
86
|
+
var py = data[pointer++] / 20;
|
|
87
|
+
box.grown(px, py);
|
|
88
|
+
path.lineTo(px, py);
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case GraphicsPathCommand.CURVE_TO: {
|
|
92
|
+
var cx = data[pointer++] / 20;
|
|
93
|
+
var cy = data[pointer++] / 20;
|
|
94
|
+
var dx = data[pointer++] / 20;
|
|
95
|
+
var dy = data[pointer++] / 20;
|
|
96
|
+
box.grown(cx, cy);
|
|
97
|
+
box.grown(dx, dy);
|
|
98
|
+
path.quadraticCurveTo(cx, cy, dx, dy);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//path.closePath();
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
path: path,
|
|
106
|
+
char: char,
|
|
107
|
+
rect: box.toRect(),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
FNTGeneratorCanvas.sortPatches = function (a, b) {
|
|
111
|
+
return a.rect.height - b.rect.height;
|
|
112
|
+
};
|
|
113
|
+
FNTGeneratorCanvas.render = function (table, context, size, fontSize, padding) {
|
|
114
|
+
if (fontSize === void 0) { fontSize = 0; }
|
|
115
|
+
if (padding === void 0) { padding = 0; }
|
|
116
|
+
var chars = table.get_font_chars();
|
|
117
|
+
var patches = [];
|
|
118
|
+
var doublePad = padding * 2;
|
|
119
|
+
var totalArea = 0;
|
|
120
|
+
var scale = 1;
|
|
121
|
+
for (var _i = 0, chars_1 = chars; _i < chars_1.length; _i++) {
|
|
122
|
+
var char = chars_1[_i];
|
|
123
|
+
var path = FNTGeneratorCanvas.transformChar(char);
|
|
124
|
+
if (!path) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
totalArea += (doublePad + path.rect.width) * (doublePad + path.rect.height);
|
|
128
|
+
patches.push(path);
|
|
129
|
+
}
|
|
130
|
+
patches.sort(FNTGeneratorCanvas.sortPatches);
|
|
131
|
+
// TODO compute valid scale when fontSize is 0
|
|
132
|
+
if (fontSize) {
|
|
133
|
+
table.initFontSize(fontSize);
|
|
134
|
+
scale = /* 20 * table._size_multiply **/ size / table.get_font_em_size();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Render glyphs onto canvas
|
|
138
|
+
* We will render glyphs as white and background as black transparent
|
|
139
|
+
*/
|
|
140
|
+
context.save();
|
|
141
|
+
context.clearRect(0, 0, size, size);
|
|
142
|
+
context.fillStyle = '#fff';
|
|
143
|
+
var tx = padding;
|
|
144
|
+
var ty = padding;
|
|
145
|
+
var maxHeight = 0;
|
|
146
|
+
// pack glyph based on size
|
|
147
|
+
for (var _a = 0, patches_1 = patches; _a < patches_1.length; _a++) {
|
|
148
|
+
var path = patches_1[_a];
|
|
149
|
+
if (!path.path) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
// if overflow - jump next location
|
|
153
|
+
if (tx + path.rect.width + doublePad >= size / scale) {
|
|
154
|
+
tx = padding;
|
|
155
|
+
ty += maxHeight + doublePad;
|
|
156
|
+
maxHeight = 0;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @todo Support multiple channel table data
|
|
160
|
+
*/
|
|
161
|
+
if (ty + path.rect.height > size / scale) {
|
|
162
|
+
console.warn('[FNTGeneratorCanvas] Font image overflow, font will corrupted!');
|
|
163
|
+
}
|
|
164
|
+
maxHeight = Math.max(path.rect.height, maxHeight);
|
|
165
|
+
context.setTransform(scale, 0, 0, scale, (tx - path.rect.x) * scale, (ty - path.rect.y) * scale);
|
|
166
|
+
context.fill(path.path);
|
|
167
|
+
//context.strokeRect(path.rect.x,path.rect.y, path.rect.width, path.rect.height);
|
|
168
|
+
path.char.fnt_rect = new Rectangle((path.rect.x) / path.char.char_width, (path.rect.y) / table.get_font_em_size(), path.rect.width / path.char.char_width, path.rect.height / table.get_font_em_size());
|
|
169
|
+
path.char.fnt_uv = new Rectangle(tx * scale / size, ty * scale / size, path.rect.width * scale / size, path.rect.height * scale / size);
|
|
170
|
+
/*
|
|
171
|
+
path.char.fnt_uv = new Rectangle(
|
|
172
|
+
(tx - path.rect.x) * scale / size,
|
|
173
|
+
1 - (ty - path.rect.y) * scale / scale,
|
|
174
|
+
path.rect.width * scale / size,
|
|
175
|
+
path.rect.height * scale / size
|
|
176
|
+
);*/
|
|
177
|
+
path.char.fnt_channel = 0;
|
|
178
|
+
tx += path.rect.width + doublePad;
|
|
179
|
+
}
|
|
180
|
+
context.restore();
|
|
181
|
+
};
|
|
182
|
+
FNTGeneratorCanvas.prototype.generate = function (font, size, fontSize, padding) {
|
|
183
|
+
var context = FNTGeneratorCanvas.getCanvasContext(size, size, this.debug);
|
|
184
|
+
var bitmaps = [];
|
|
185
|
+
for (var key in font.font_styles) {
|
|
186
|
+
var table = font.font_styles[key];
|
|
187
|
+
// render table in context
|
|
188
|
+
FNTGeneratorCanvas.render(table, context, size, fontSize, padding);
|
|
189
|
+
var data = context.getImageData(0, 0, size, size);
|
|
190
|
+
var image = new BitmapImage2D(size, size, true, 0, true, this._stage);
|
|
191
|
+
image.setPixels(new Rectangle(0, 0, size, size), data.data);
|
|
192
|
+
bitmaps.push(image);
|
|
193
|
+
table.addFNTChannel(image);
|
|
194
|
+
}
|
|
195
|
+
if (!this.debug) {
|
|
196
|
+
FNTGeneratorCanvas.freeCanvasContext(context);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
this.canvas = context.canvas;
|
|
200
|
+
}
|
|
201
|
+
return bitmaps;
|
|
202
|
+
};
|
|
203
|
+
return FNTGeneratorCanvas;
|
|
204
|
+
}(FNTGeneratorBase));
|
|
205
|
+
export { FNTGeneratorCanvas };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Stage, BitmapImage2D } from '@awayjs/stage';
|
|
2
|
+
import { Font } from './Font';
|
|
3
|
+
export declare abstract class FNTGeneratorBase {
|
|
4
|
+
protected _stage: Stage;
|
|
5
|
+
constructor(_stage: Stage);
|
|
6
|
+
abstract generate(font: Font, maxSize: number, fontSize: number, padding: number): BitmapImage2D[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=FNTGeneratrorBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FNTGeneratrorBase.d.ts","sourceRoot":"","sources":["../../../lib/text/FNTGeneratrorBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,8BAAsB,gBAAgB;IAEpC,SAAS,CAAC,MAAM,EAAE,KAAK;gBAAb,MAAM,EAAE,KAAK;aAIR,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE;CACzG"}
|
|
@@ -28,6 +28,9 @@ import { Rectangle } from '@awayjs/core';
|
|
|
28
28
|
* property description.</p>
|
|
29
29
|
*/
|
|
30
30
|
export declare class TesselatedFontChar {
|
|
31
|
+
fill_data: AttributesBuffer;
|
|
32
|
+
stroke_data: AttributesBuffer;
|
|
33
|
+
fill_data_path: GraphicsPath;
|
|
31
34
|
/**
|
|
32
35
|
* The width of the char
|
|
33
36
|
*/
|
|
@@ -38,11 +41,10 @@ export declare class TesselatedFontChar {
|
|
|
38
41
|
fnt_uv: Rectangle;
|
|
39
42
|
fnt_channel: number;
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
44
|
+
* What is scale was used for generating last tesselation
|
|
45
|
+
* Used for reduce a vertices count
|
|
42
46
|
*/
|
|
43
|
-
|
|
44
|
-
fill_data: AttributesBuffer;
|
|
45
|
-
fill_data_path: GraphicsPath;
|
|
47
|
+
lastTesselatedScale: number;
|
|
46
48
|
/**
|
|
47
49
|
* the char_codes that this geom has kerning set for
|
|
48
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TesselatedFontChar.d.ts","sourceRoot":"","sources":["../../../lib/text/TesselatedFontChar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"TesselatedFontChar.d.ts","sourceRoot":"","sources":["../../../lib/text/TesselatedFontChar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,kBAAkB;IA6BtB,SAAS,EAAE,gBAAgB;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,cAAc,EAAE,YAAY;IA7BpC;;OAEG;IACI,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAK;IAE/B;;;OAGG;IACI,mBAAmB,EAAE,MAAM,CAAK;IAEvC;;OAEG;IACI,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAI;IAC1C;;OAEG;IACI,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAI;gBAG/B,SAAS,GAAE,gBAAuB,EAClC,WAAW,GAAE,gBAAuB,EACpC,cAAc,GAAE,YAAmB;IAIpC,OAAO;CAed"}
|
|
@@ -29,7 +29,15 @@ var TesselatedFontChar = /** @class */ (function () {
|
|
|
29
29
|
if (fill_data === void 0) { fill_data = null; }
|
|
30
30
|
if (stroke_data === void 0) { stroke_data = null; }
|
|
31
31
|
if (fill_data_path === void 0) { fill_data_path = null; }
|
|
32
|
+
this.fill_data = fill_data;
|
|
33
|
+
this.stroke_data = stroke_data;
|
|
34
|
+
this.fill_data_path = fill_data_path;
|
|
32
35
|
this.fnt_channel = 0;
|
|
36
|
+
/**
|
|
37
|
+
* What is scale was used for generating last tesselation
|
|
38
|
+
* Used for reduce a vertices count
|
|
39
|
+
*/
|
|
40
|
+
this.lastTesselatedScale = 0;
|
|
33
41
|
/**
|
|
34
42
|
* the char_codes that this geom has kerning set for
|
|
35
43
|
*/
|
|
@@ -38,9 +46,6 @@ var TesselatedFontChar = /** @class */ (function () {
|
|
|
38
46
|
* the kerning values per char_code
|
|
39
47
|
*/
|
|
40
48
|
this.kerningValues = [];
|
|
41
|
-
this.fill_data = fill_data;
|
|
42
|
-
this.stroke_data = stroke_data;
|
|
43
|
-
this.fill_data_path = fill_data_path;
|
|
44
49
|
}
|
|
45
50
|
TesselatedFontChar.prototype.dispose = function () {
|
|
46
51
|
if (this.stroke_data) {
|