@galacean/effects-threejs 2.10.0-alpha.4 → 2.10.0-alpha.5
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/dist/index.js +729 -2303
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +730 -2296
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.10.0-alpha.
|
|
6
|
+
* Version: v2.10.0-alpha.5
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as THREE from 'three';
|
|
@@ -2934,6 +2934,11 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
2934
2934
|
PluginSystem.getPlugins = function getPlugins() {
|
|
2935
2935
|
return plugins;
|
|
2936
2936
|
};
|
|
2937
|
+
PluginSystem.notifyCompositionCreating = function notifyCompositionCreating(composition, scene) {
|
|
2938
|
+
plugins.forEach(function(plugin) {
|
|
2939
|
+
return plugin.onCompositionCreating(composition, scene);
|
|
2940
|
+
});
|
|
2941
|
+
};
|
|
2937
2942
|
PluginSystem.notifyCompositionCreated = function notifyCompositionCreated(composition, scene) {
|
|
2938
2943
|
plugins.forEach(function(plugin) {
|
|
2939
2944
|
return plugin.onCompositionCreated(composition, scene);
|
|
@@ -3026,6 +3031,12 @@ function getPluginUsageInfo(name) {
|
|
|
3026
3031
|
* @param engine - 引擎实例
|
|
3027
3032
|
*/ _proto.onAssetsLoadFinish = function onAssetsLoadFinish(scene, options, engine) {};
|
|
3028
3033
|
/**
|
|
3034
|
+
* 合成内容开始创建前触发。
|
|
3035
|
+
* 此时 root、pluginRoot 和 sceneRoot 已创建,但场景内容尚未实例化。
|
|
3036
|
+
* @param composition - 正在创建的合成对象
|
|
3037
|
+
* @param scene - 场景对象
|
|
3038
|
+
*/ _proto.onCompositionCreating = function onCompositionCreating(composition, scene) {};
|
|
3039
|
+
/**
|
|
3029
3040
|
* 合成创建完成后触发。
|
|
3030
3041
|
* @param composition - 合成对象
|
|
3031
3042
|
* @param scene - 场景对象
|
|
@@ -15634,35 +15645,35 @@ function vecMulCombine(out, a, b) {
|
|
|
15634
15645
|
}
|
|
15635
15646
|
return out;
|
|
15636
15647
|
}
|
|
15637
|
-
var _obj$
|
|
15638
|
-
var particleOriginTranslateMap$1 = (_obj$
|
|
15648
|
+
var _obj$6;
|
|
15649
|
+
var particleOriginTranslateMap$1 = (_obj$6 = {}, _obj$6[ParticleOrigin.PARTICLE_ORIGIN_CENTER] = [
|
|
15639
15650
|
0,
|
|
15640
15651
|
0
|
|
15641
|
-
], _obj$
|
|
15652
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_CENTER_BOTTOM] = [
|
|
15642
15653
|
0,
|
|
15643
15654
|
-0.5
|
|
15644
|
-
], _obj$
|
|
15655
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_CENTER_TOP] = [
|
|
15645
15656
|
0,
|
|
15646
15657
|
0.5
|
|
15647
|
-
], _obj$
|
|
15658
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_LEFT_TOP] = [
|
|
15648
15659
|
-0.5,
|
|
15649
15660
|
0.5
|
|
15650
|
-
], _obj$
|
|
15661
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_LEFT_CENTER] = [
|
|
15651
15662
|
-0.5,
|
|
15652
15663
|
0
|
|
15653
|
-
], _obj$
|
|
15664
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_LEFT_BOTTOM] = [
|
|
15654
15665
|
-0.5,
|
|
15655
15666
|
-0.5
|
|
15656
|
-
], _obj$
|
|
15667
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_CENTER] = [
|
|
15657
15668
|
0.5,
|
|
15658
15669
|
0
|
|
15659
|
-
], _obj$
|
|
15670
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_BOTTOM] = [
|
|
15660
15671
|
0.5,
|
|
15661
15672
|
-0.5
|
|
15662
|
-
], _obj$
|
|
15673
|
+
], _obj$6[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_TOP] = [
|
|
15663
15674
|
0.5,
|
|
15664
15675
|
0.5
|
|
15665
|
-
], _obj$
|
|
15676
|
+
], _obj$6);
|
|
15666
15677
|
function nearestPowerOfTwo(value) {
|
|
15667
15678
|
return Math.pow(2, Math.round(Math.log(value) / Math.LN2));
|
|
15668
15679
|
}
|
|
@@ -17400,27 +17411,27 @@ function oldBezierKeyFramesToNew(props) {
|
|
|
17400
17411
|
* 对象引用阶梯曲线(spec ValueType.REFERENCE_CURVE)。
|
|
17401
17412
|
* props 为 [[time, value], ...],value 为已解析的对象引用实例。
|
|
17402
17413
|
*/ var REFERENCE_CURVE = 28;
|
|
17403
|
-
var _obj$
|
|
17404
|
-
var map$1 = (_obj$
|
|
17414
|
+
var _obj$5;
|
|
17415
|
+
var map$1 = (_obj$5 = {}, _obj$5[ValueType.RANDOM] = function(props) {
|
|
17405
17416
|
if (_instanceof1(props[0], Array)) {
|
|
17406
17417
|
return new RandomVectorValue(props);
|
|
17407
17418
|
}
|
|
17408
17419
|
return new RandomValue(props);
|
|
17409
|
-
}, _obj$
|
|
17420
|
+
}, _obj$5[ValueType.CONSTANT] = function(props) {
|
|
17410
17421
|
return new StaticValue(props);
|
|
17411
|
-
}, _obj$
|
|
17422
|
+
}, _obj$5[ValueType.CONSTANT_VEC2] = function(props) {
|
|
17412
17423
|
return new StaticValue(props);
|
|
17413
|
-
}, _obj$
|
|
17424
|
+
}, _obj$5[ValueType.CONSTANT_VEC3] = function(props) {
|
|
17414
17425
|
return new StaticValue(props);
|
|
17415
|
-
}, _obj$
|
|
17426
|
+
}, _obj$5[ValueType.CONSTANT_VEC4] = function(props) {
|
|
17416
17427
|
return new StaticValue(props);
|
|
17417
|
-
}, _obj$
|
|
17428
|
+
}, _obj$5[ValueType.RGBA_COLOR] = function(props) {
|
|
17418
17429
|
return new StaticValue(props);
|
|
17419
|
-
}, _obj$
|
|
17430
|
+
}, _obj$5[ValueType.COLORS] = function(props) {
|
|
17420
17431
|
return new RandomSetValue(props.map(function(c) {
|
|
17421
17432
|
return colorToArr$1(c, false);
|
|
17422
17433
|
}));
|
|
17423
|
-
}, _obj$
|
|
17434
|
+
}, _obj$5[ValueType.LINE] = function(props) {
|
|
17424
17435
|
if (props.length === 2 && props[0][0] === 0 && props[1][0] === 1) {
|
|
17425
17436
|
return new LinearValue([
|
|
17426
17437
|
props[0][1],
|
|
@@ -17428,38 +17439,38 @@ var map$1 = (_obj$6 = {}, _obj$6[ValueType.RANDOM] = function(props) {
|
|
|
17428
17439
|
]);
|
|
17429
17440
|
}
|
|
17430
17441
|
return new LineSegments(props);
|
|
17431
|
-
}, _obj$
|
|
17442
|
+
}, _obj$5[ValueType.GRADIENT_COLOR] = function(props) {
|
|
17432
17443
|
return new GradientValue(props);
|
|
17433
|
-
}, _obj$
|
|
17444
|
+
}, _obj$5[ValueType.LINEAR_PATH] = function(pros) {
|
|
17434
17445
|
return new PathSegments(pros);
|
|
17435
|
-
}, _obj$
|
|
17446
|
+
}, _obj$5[ValueType.BEZIER_CURVE] = function(props) {
|
|
17436
17447
|
if (props.length === 1) {
|
|
17437
17448
|
return new StaticValue(props[0][1][1]);
|
|
17438
17449
|
}
|
|
17439
17450
|
return new BezierCurve(props);
|
|
17440
|
-
}, _obj$
|
|
17451
|
+
}, _obj$5[ValueType.BEZIER_CURVE_PATH] = function(props) {
|
|
17441
17452
|
if (props[0].length === 1) {
|
|
17442
17453
|
return new StaticValue(_construct(Vector3, [].concat(props[1][0])));
|
|
17443
17454
|
}
|
|
17444
17455
|
return new BezierCurvePath(props);
|
|
17445
|
-
}, _obj$
|
|
17456
|
+
}, _obj$5[ValueType.BEZIER_CURVE_QUAT] = function(props) {
|
|
17446
17457
|
if (props[0].length === 1) {
|
|
17447
17458
|
return new StaticValue(_construct(Quaternion, [].concat(props[1][0])));
|
|
17448
17459
|
}
|
|
17449
17460
|
return new BezierCurveQuat(props);
|
|
17450
|
-
}, _obj$
|
|
17461
|
+
}, _obj$5[ValueType.COLOR_CURVE] = function(props) {
|
|
17451
17462
|
return new ColorCurve(props);
|
|
17452
|
-
}, _obj$
|
|
17463
|
+
}, _obj$5[ValueType.VECTOR4_CURVE] = function(props) {
|
|
17453
17464
|
return new Vector4Curve(props);
|
|
17454
|
-
}, _obj$
|
|
17465
|
+
}, _obj$5[ValueType.VECTOR2_CURVE] = function(props) {
|
|
17455
17466
|
return new Vector2Curve(props);
|
|
17456
17467
|
}, // TODO: add spec
|
|
17457
|
-
_obj$
|
|
17468
|
+
_obj$5[VECTOR3_CURVE] = function(props) {
|
|
17458
17469
|
return new Vector3Curve(props);
|
|
17459
17470
|
}, // 对象引用阶梯曲线(不插值):props.data 为 [time, value][],value 已解析为 EffectsObject
|
|
17460
|
-
_obj$
|
|
17471
|
+
_obj$5[REFERENCE_CURVE] = function(props) {
|
|
17461
17472
|
return new ReferenceCurve(props);
|
|
17462
|
-
}, _obj$
|
|
17473
|
+
}, _obj$5);
|
|
17463
17474
|
function createValueGetter(args) {
|
|
17464
17475
|
if (!args || !isNaN(+args)) {
|
|
17465
17476
|
return new StaticValue(args || 0);
|
|
@@ -21400,8 +21411,8 @@ var vertexBufferSemanticMap = {
|
|
|
21400
21411
|
TANGENT_BS2: "aTargetTangent2",
|
|
21401
21412
|
TANGENT_BS3: "aTargetTangent3"
|
|
21402
21413
|
};
|
|
21403
|
-
var _obj$
|
|
21404
|
-
var BYTES_TYPE_MAP = (_obj$
|
|
21414
|
+
var _obj$4;
|
|
21415
|
+
var BYTES_TYPE_MAP = (_obj$4 = {}, _obj$4[BufferDataType.Float] = 4, _obj$4[BufferDataType.Int] = 4, _obj$4[BufferDataType.UnsignedInt] = 4, _obj$4[BufferDataType.Short] = 2, _obj$4[BufferDataType.UnsignedShort] = 2, _obj$4[BufferDataType.Byte] = 1, _obj$4[BufferDataType.UnsignedByte] = 1, _obj$4);
|
|
21405
21416
|
function generateEmptyTypedArray(type) {
|
|
21406
21417
|
return createTypedArray(type, 0);
|
|
21407
21418
|
}
|
|
@@ -22918,7 +22929,7 @@ var canvasPool = new CanvasPool();
|
|
|
22918
22929
|
* `ATLAS_SIZE × ATLAS_SIZE` 的离屏 canvas atlas,字符按需逐个绘制并打包,
|
|
22919
22930
|
* `Graphics.drawText` 通过逐字 quad 引用 atlas 子矩形渲染。
|
|
22920
22931
|
*
|
|
22921
|
-
* - 同一段文本不同颜色不会重复 upload(颜色由顶点 `vColor`
|
|
22932
|
+
* - 同一段文本不同颜色不会重复 upload(颜色由顶点 `vColor` 与字形 RGBA 相乘)
|
|
22922
22933
|
* - 同一字体/字号下重复字符只渲染一次,显著减少 canvas → texture 上传次数
|
|
22923
22934
|
*
|
|
22924
22935
|
* 入参全部展开(避免调用方每帧创建临时 style 对象触发 GC)
|
|
@@ -22932,7 +22943,7 @@ var canvasPool = new CanvasPool();
|
|
|
22932
22943
|
/**
|
|
22933
22944
|
* 取(必要时新建)对应字体的字符 atlas
|
|
22934
22945
|
*/ _proto.getAtlas = function getAtlas(fontSize, fontFamily, fontWeight, fontStyle) {
|
|
22935
|
-
//
|
|
22946
|
+
// 字形 atlas 跟随 Engine.pixelRatio。
|
|
22936
22947
|
var resolution = this.engine.pixelRatio;
|
|
22937
22948
|
if (resolution !== this.resolution) {
|
|
22938
22949
|
this.clear();
|
|
@@ -22953,14 +22964,11 @@ var canvasPool = new CanvasPool();
|
|
|
22953
22964
|
var probeCtx = probeCanvasAndContext.context;
|
|
22954
22965
|
var ascentPx = fontSize * 0.8 * resolution;
|
|
22955
22966
|
var descentPx = fontSize * 0.2 * resolution;
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
} finally{
|
|
22962
|
-
canvasPool.releaseCanvasAndContext(probeCanvasAndContext);
|
|
22963
|
-
}
|
|
22967
|
+
probeCtx.font = scaledFontString;
|
|
22968
|
+
var m = probeCtx.measureText(METRICS_STRING + BASELINE_SYMBOL);
|
|
22969
|
+
ascentPx = m.actualBoundingBoxAscent || ascentPx;
|
|
22970
|
+
descentPx = m.actualBoundingBoxDescent || descentPx;
|
|
22971
|
+
canvasPool.releaseCanvasAndContext(probeCanvasAndContext);
|
|
22964
22972
|
var atlas = new GlyphAtlas(this.engine, scaledFontString, ascentPx, descentPx, fontStyle, resolution);
|
|
22965
22973
|
this.atlases.set(fontKey, atlas);
|
|
22966
22974
|
return atlas;
|
|
@@ -22996,6 +23004,10 @@ var FULL_REGION = {
|
|
|
22996
23004
|
u1: 1,
|
|
22997
23005
|
v1: 1
|
|
22998
23006
|
};
|
|
23007
|
+
var NINE_PATCH_DRAW_SOURCE_SIZE = "aDrawSourceSize";
|
|
23008
|
+
var NINE_PATCH_SOURCE_RECT = "aSourceRect";
|
|
23009
|
+
var NINE_PATCH_MARGINS = "aMargins";
|
|
23010
|
+
var NINE_PATCH_OPTIONS = "aOptions";
|
|
22999
23011
|
var Graphics = /*#__PURE__*/ function() {
|
|
23000
23012
|
function Graphics(engine) {
|
|
23001
23013
|
this.engine = engine;
|
|
@@ -23009,6 +23021,10 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23009
23021
|
this.colors = [];
|
|
23010
23022
|
this.uvs = [];
|
|
23011
23023
|
this.indices = [];
|
|
23024
|
+
this.ninePatchDrawSourceSizes = [];
|
|
23025
|
+
this.ninePatchSourceRects = [];
|
|
23026
|
+
this.ninePatchMargins = [];
|
|
23027
|
+
this.ninePatchOptions = [];
|
|
23012
23028
|
this.lineStyle = {
|
|
23013
23029
|
width: 1,
|
|
23014
23030
|
alignment: 0.5,
|
|
@@ -23020,6 +23036,9 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23020
23036
|
this.currentBatchTexture = null;
|
|
23021
23037
|
this.transformStack = [];
|
|
23022
23038
|
this.currentTransform = Matrix3.fromIdentity();
|
|
23039
|
+
this.clipStack = [];
|
|
23040
|
+
this.logicalWidth = 1;
|
|
23041
|
+
this.logicalHeight = 1;
|
|
23023
23042
|
var _obj;
|
|
23024
23043
|
this.geometry = Geometry.create(this.engine, {
|
|
23025
23044
|
attributes: (_obj = {}, _obj[VertexBuffer.PositionKind] = {
|
|
@@ -23085,6 +23104,51 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23085
23104
|
drawCount: 6,
|
|
23086
23105
|
bufferUsage: glContext.DYNAMIC_DRAW
|
|
23087
23106
|
});
|
|
23107
|
+
var _obj1;
|
|
23108
|
+
this.ninePatchGeometry = Geometry.create(this.engine, {
|
|
23109
|
+
attributes: (_obj1 = {}, _obj1[VertexBuffer.PositionKind] = {
|
|
23110
|
+
type: glContext.FLOAT,
|
|
23111
|
+
size: 2,
|
|
23112
|
+
data: new Float32Array(8)
|
|
23113
|
+
}, _obj1[VertexBuffer.ColorKind] = {
|
|
23114
|
+
type: glContext.FLOAT,
|
|
23115
|
+
size: 4,
|
|
23116
|
+
data: new Float32Array(16)
|
|
23117
|
+
}, _obj1[VertexBuffer.UVKind] = {
|
|
23118
|
+
type: glContext.FLOAT,
|
|
23119
|
+
size: 2,
|
|
23120
|
+
data: new Float32Array(8)
|
|
23121
|
+
}, _obj1[NINE_PATCH_DRAW_SOURCE_SIZE] = {
|
|
23122
|
+
type: glContext.FLOAT,
|
|
23123
|
+
size: 4,
|
|
23124
|
+
data: new Float32Array(16)
|
|
23125
|
+
}, _obj1[NINE_PATCH_SOURCE_RECT] = {
|
|
23126
|
+
type: glContext.FLOAT,
|
|
23127
|
+
size: 4,
|
|
23128
|
+
data: new Float32Array(16)
|
|
23129
|
+
}, _obj1[NINE_PATCH_MARGINS] = {
|
|
23130
|
+
type: glContext.FLOAT,
|
|
23131
|
+
size: 4,
|
|
23132
|
+
data: new Float32Array(16)
|
|
23133
|
+
}, _obj1[NINE_PATCH_OPTIONS] = {
|
|
23134
|
+
type: glContext.FLOAT,
|
|
23135
|
+
size: 4,
|
|
23136
|
+
data: new Float32Array(16)
|
|
23137
|
+
}, _obj1),
|
|
23138
|
+
indices: {
|
|
23139
|
+
data: new Uint16Array([
|
|
23140
|
+
0,
|
|
23141
|
+
1,
|
|
23142
|
+
2,
|
|
23143
|
+
2,
|
|
23144
|
+
1,
|
|
23145
|
+
3
|
|
23146
|
+
])
|
|
23147
|
+
},
|
|
23148
|
+
mode: glContext.TRIANGLES,
|
|
23149
|
+
drawCount: 6,
|
|
23150
|
+
bufferUsage: glContext.DYNAMIC_DRAW
|
|
23151
|
+
});
|
|
23088
23152
|
this.coloredMaterial = Material.create(this.engine, {
|
|
23089
23153
|
shader: {
|
|
23090
23154
|
vertex: "precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n varying vec4 vColor;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",
|
|
@@ -23103,12 +23167,21 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23103
23167
|
this.texturedMaterial.depthTest = false;
|
|
23104
23168
|
this.texturedMaterial.depthMask = false;
|
|
23105
23169
|
this.texturedMaterial.blending = true;
|
|
23106
|
-
|
|
23170
|
+
this.ninePatchMaterial = Material.create(this.engine, {
|
|
23171
|
+
shader: {
|
|
23172
|
+
vertex: "precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n attribute vec2 aUV;\n attribute vec4 aDrawSourceSize;\n attribute vec4 aSourceRect;\n attribute vec4 aMargins;\n attribute vec4 aOptions;\n varying vec4 vColor;\n varying vec2 vUV;\n varying vec4 vDrawSourceSize;\n varying vec4 vSourceRect;\n varying vec4 vMargins;\n varying vec4 vOptions;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n vUV = aUV;\n vDrawSourceSize = aDrawSourceSize;\n vSourceRect = aSourceRect;\n vMargins = aMargins;\n vOptions = aOptions;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",
|
|
23173
|
+
fragment: "precision highp float;\n varying vec4 vColor;\n varying vec2 vUV;\n varying vec4 vDrawSourceSize;\n varying vec4 vSourceRect;\n varying vec4 vMargins;\n varying vec4 vOptions;\n uniform sampler2D uMainTexture;\n\n float mapNinePatchAxis(\n float pixel,\n float drawSize,\n float sourceSize,\n float marginBegin,\n float marginEnd,\n float repeatMode,\n inout float drawCenter\n ) {\n if (pixel < marginBegin) {\n return pixel / sourceSize;\n } else if (pixel >= drawSize - marginEnd) {\n return (sourceSize - (drawSize - pixel)) / sourceSize;\n } else {\n if (vOptions.z < 0.5) {\n drawCenter -= 1.0;\n }\n\n if (repeatMode < 0.5) {\n float ratio = (pixel - marginBegin) / (drawSize - marginBegin - marginEnd);\n return (marginBegin + ratio * (sourceSize - marginBegin - marginEnd)) / sourceSize;\n } else if (repeatMode < 1.5) {\n float offset = mod(pixel - marginBegin, sourceSize - marginBegin - marginEnd);\n return (marginBegin + offset) / sourceSize;\n } else {\n float drawArea = drawSize - marginBegin - marginEnd;\n float sourceArea = sourceSize - marginBegin - marginEnd;\n float scale = max(1.0, floor(drawArea / max(sourceArea, 0.0000001) + 0.5));\n float ratio = mod((pixel - marginBegin) / drawArea * scale, 1.0);\n return (marginBegin + ratio * sourceArea) / sourceSize;\n }\n }\n }\n\n void main() {\n vec2 pixel = vec2(vUV.x, 1.0 - vUV.y) * vDrawSourceSize.xy;\n float drawCenter = 2.0;\n vec2 sourceUV = vec2(\n mapNinePatchAxis(\n pixel.x, vDrawSourceSize.x, vDrawSourceSize.z,\n vMargins.x, vMargins.z, vOptions.x, drawCenter\n ),\n mapNinePatchAxis(\n pixel.y, vDrawSourceSize.y, vDrawSourceSize.w,\n vMargins.y, vMargins.w, vOptions.y, drawCenter\n )\n );\n\n if (drawCenter < 0.5) {\n discard;\n }\n\n vec2 uv = vec2(\n vSourceRect.x + sourceUV.x * vSourceRect.z,\n vSourceRect.y - sourceUV.y * vSourceRect.w\n );\n vec4 color = texture2D(uMainTexture, uv) * vColor;\n color.rgb *= color.a;\n gl_FragColor = color;\n }"
|
|
23174
|
+
}
|
|
23175
|
+
});
|
|
23176
|
+
this.ninePatchMaterial.depthTest = false;
|
|
23177
|
+
this.ninePatchMaterial.depthMask = false;
|
|
23178
|
+
this.ninePatchMaterial.blending = true;
|
|
23179
|
+
// 文本 atlas 在上传时预乘 alpha,因此纹理 RGB 只需乘顶点色和顶点 alpha。
|
|
23107
23180
|
// 单独使用 material,避免改变 drawTexture 对普通非预乘纹理的处理。
|
|
23108
23181
|
this.textMaterial = Material.create(this.engine, {
|
|
23109
23182
|
shader: {
|
|
23110
23183
|
vertex: "precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n attribute vec2 aUV;\n varying vec4 vColor;\n varying vec2 vUV;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n vUV = aUV;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",
|
|
23111
|
-
fragment: "precision highp float;\n varying vec4 vColor;\n varying vec2 vUV;\n uniform sampler2D uMainTexture;\n void main() {\n
|
|
23184
|
+
fragment: "precision highp float;\n varying vec4 vColor;\n varying vec2 vUV;\n uniform sampler2D uMainTexture;\n void main() {\n vec4 textureColor = texture2D(uMainTexture, vUV);\n float alpha = textureColor.a * vColor.a;\n vec3 rgb = textureColor.rgb * vColor.rgb * vColor.a;\n gl_FragColor = vec4(rgb, alpha);\n }"
|
|
23112
23185
|
}
|
|
23113
23186
|
});
|
|
23114
23187
|
this.textMaterial.depthTest = false;
|
|
@@ -23124,25 +23197,36 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23124
23197
|
this.vertices.length = 0;
|
|
23125
23198
|
this.colors.length = 0;
|
|
23126
23199
|
this.uvs.length = 0;
|
|
23200
|
+
this.ninePatchDrawSourceSizes.length = 0;
|
|
23201
|
+
this.ninePatchSourceRects.length = 0;
|
|
23202
|
+
this.ninePatchMargins.length = 0;
|
|
23203
|
+
this.ninePatchOptions.length = 0;
|
|
23127
23204
|
this.transformStack = [];
|
|
23128
23205
|
this.currentTransform = Matrix3.fromIdentity();
|
|
23206
|
+
this.clipStack = [];
|
|
23129
23207
|
this.currentBatchType = "colored";
|
|
23130
23208
|
this.currentBatchTexture = null;
|
|
23209
|
+
this.engine.setScissorTest(false);
|
|
23131
23210
|
// 创建从屏幕坐标到 NDC 的投影矩阵,屏幕坐标:(0, 0) 在左上角,(width, height) 在右下角,+Y 向下。
|
|
23132
|
-
var
|
|
23211
|
+
var bounds = this.engine.canvas.getBoundingClientRect();
|
|
23212
|
+
var width = bounds.width || this.engine.canvas.width / this.engine.pixelRatio || 1;
|
|
23213
|
+
var height = bounds.height || this.engine.canvas.height / this.engine.pixelRatio || 1;
|
|
23214
|
+
this.logicalWidth = width;
|
|
23215
|
+
this.logicalHeight = height;
|
|
23133
23216
|
// 正交投影矩阵:将屏幕坐标 [0, width] x [0, height] 映射到 NDC [-1, 1] x [-1, 1]
|
|
23134
23217
|
var projectionMatrix = new Matrix4(2 / width, 0, 0, 0, 0, -2 / height, 0, 0, 0, 0, -1, 0, -1, 1, 0, 1 // 第四列
|
|
23135
23218
|
);
|
|
23136
23219
|
this.coloredMaterial.setMatrix("effects_MatrixVP", projectionMatrix);
|
|
23137
23220
|
this.texturedMaterial.setMatrix("effects_MatrixVP", projectionMatrix);
|
|
23138
23221
|
this.textMaterial.setMatrix("effects_MatrixVP", projectionMatrix);
|
|
23222
|
+
this.ninePatchMaterial.setMatrix("effects_MatrixVP", projectionMatrix);
|
|
23139
23223
|
};
|
|
23140
23224
|
/**
|
|
23141
23225
|
* 将当前变换压入栈,并设置新的变换
|
|
23142
23226
|
* @param transform - 新的变换矩阵(会与当前变换相乘)
|
|
23143
23227
|
*/ _proto.pushTransform = function pushTransform(transform) {
|
|
23144
23228
|
this.transformStack.push(this.currentTransform.clone());
|
|
23145
|
-
this.currentTransform = this.currentTransform.
|
|
23229
|
+
this.currentTransform = this.currentTransform.multiply(transform);
|
|
23146
23230
|
};
|
|
23147
23231
|
/**
|
|
23148
23232
|
* 恢复上一个变换
|
|
@@ -23154,10 +23238,81 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23154
23238
|
}
|
|
23155
23239
|
this.currentTransform = transform;
|
|
23156
23240
|
};
|
|
23241
|
+
/** Pushes a local rectangular child clip using a screen-space AABB scissor. */ _proto.pushClipRect = function pushClipRect(x, y, width, height) {
|
|
23242
|
+
var elements = this.currentTransform.elements;
|
|
23243
|
+
var corners = [
|
|
23244
|
+
[
|
|
23245
|
+
x,
|
|
23246
|
+
y
|
|
23247
|
+
],
|
|
23248
|
+
[
|
|
23249
|
+
x + width,
|
|
23250
|
+
y
|
|
23251
|
+
],
|
|
23252
|
+
[
|
|
23253
|
+
x,
|
|
23254
|
+
y + height
|
|
23255
|
+
],
|
|
23256
|
+
[
|
|
23257
|
+
x + width,
|
|
23258
|
+
y + height
|
|
23259
|
+
]
|
|
23260
|
+
];
|
|
23261
|
+
var left = Infinity;
|
|
23262
|
+
var top = Infinity;
|
|
23263
|
+
var right = -Infinity;
|
|
23264
|
+
var bottom = -Infinity;
|
|
23265
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(corners), _step; !(_step = _iterator()).done;){
|
|
23266
|
+
var corner = _step.value;
|
|
23267
|
+
var transformedX = elements[0] * corner[0] + elements[3] * corner[1] + elements[6];
|
|
23268
|
+
var transformedY = elements[1] * corner[0] + elements[4] * corner[1] + elements[7];
|
|
23269
|
+
left = Math.min(left, transformedX);
|
|
23270
|
+
top = Math.min(top, transformedY);
|
|
23271
|
+
right = Math.max(right, transformedX);
|
|
23272
|
+
bottom = Math.max(bottom, transformedY);
|
|
23273
|
+
}
|
|
23274
|
+
var parent = this.clipStack[this.clipStack.length - 1];
|
|
23275
|
+
if (parent) {
|
|
23276
|
+
left = Math.max(left, parent.x);
|
|
23277
|
+
top = Math.max(top, parent.y);
|
|
23278
|
+
right = Math.min(right, parent.x + parent.width);
|
|
23279
|
+
bottom = Math.min(bottom, parent.y + parent.height);
|
|
23280
|
+
}
|
|
23281
|
+
var clip = {
|
|
23282
|
+
x: left,
|
|
23283
|
+
y: top,
|
|
23284
|
+
width: Math.max(0, right - left),
|
|
23285
|
+
height: Math.max(0, bottom - top)
|
|
23286
|
+
};
|
|
23287
|
+
var previous = parent;
|
|
23288
|
+
this.clipStack.push(clip);
|
|
23289
|
+
if (!this.clipRectsEqual(previous, clip)) {
|
|
23290
|
+
this.flushBatch();
|
|
23291
|
+
this.applyClipRect(clip);
|
|
23292
|
+
}
|
|
23293
|
+
};
|
|
23294
|
+
/** Restores the parent rectangular clip. */ _proto.popClipRect = function popClipRect() {
|
|
23295
|
+
var previous = this.clipStack.pop();
|
|
23296
|
+
if (!previous) {
|
|
23297
|
+
console.warn("Graphics: clip stack is empty.");
|
|
23298
|
+
return;
|
|
23299
|
+
}
|
|
23300
|
+
var clip = this.clipStack[this.clipStack.length - 1];
|
|
23301
|
+
if (!this.clipRectsEqual(previous, clip)) {
|
|
23302
|
+
this.flushBatch();
|
|
23303
|
+
if (clip) {
|
|
23304
|
+
this.applyClipRect(clip);
|
|
23305
|
+
} else {
|
|
23306
|
+
this.engine.setScissorTest(false);
|
|
23307
|
+
}
|
|
23308
|
+
}
|
|
23309
|
+
};
|
|
23157
23310
|
/**
|
|
23158
23311
|
* 刷新并渲染所有累积的绘制命令
|
|
23159
23312
|
*/ _proto.end = function end() {
|
|
23160
23313
|
this.flushBatch();
|
|
23314
|
+
this.clipStack = [];
|
|
23315
|
+
this.engine.setScissorTest(false);
|
|
23161
23316
|
};
|
|
23162
23317
|
/**
|
|
23163
23318
|
* 切换到指定批次类型/纹理。若与当前批次不一致,先 flush 已累积顶点
|
|
@@ -23170,6 +23325,24 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23170
23325
|
this.currentBatchType = type;
|
|
23171
23326
|
this.currentBatchTexture = texture;
|
|
23172
23327
|
};
|
|
23328
|
+
_proto.applyClipRect = function applyClipRect(clip) {
|
|
23329
|
+
var framebufferWidth = this.engine.canvas.width;
|
|
23330
|
+
var framebufferHeight = this.engine.canvas.height;
|
|
23331
|
+
var scaleX = framebufferWidth / this.logicalWidth;
|
|
23332
|
+
var scaleY = framebufferHeight / this.logicalHeight;
|
|
23333
|
+
var left = Math.max(0, Math.min(framebufferWidth, Math.floor(clip.x * scaleX)));
|
|
23334
|
+
var top = Math.max(0, Math.min(framebufferHeight, Math.floor(clip.y * scaleY)));
|
|
23335
|
+
var right = Math.max(left, Math.min(framebufferWidth, Math.ceil((clip.x + clip.width) * scaleX)));
|
|
23336
|
+
var bottom = Math.max(top, Math.min(framebufferHeight, Math.ceil((clip.y + clip.height) * scaleY)));
|
|
23337
|
+
this.engine.setScissorTest(true);
|
|
23338
|
+
this.engine.setScissor(left, framebufferHeight - bottom, right - left, bottom - top);
|
|
23339
|
+
};
|
|
23340
|
+
_proto.clipRectsEqual = function clipRectsEqual(left, right) {
|
|
23341
|
+
if (!left || !right) {
|
|
23342
|
+
return left === right;
|
|
23343
|
+
}
|
|
23344
|
+
return left.x === right.x && left.y === right.y && left.width === right.width && left.height === right.height;
|
|
23345
|
+
};
|
|
23173
23346
|
/**
|
|
23174
23347
|
* 提交当前累积的顶点到 renderer,清空缓冲(批次内部 flush 不重置 batchType)
|
|
23175
23348
|
*/ _proto.flushBatch = function flushBatch() {
|
|
@@ -23183,37 +23356,48 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23183
23356
|
var colorsArray = new Float32Array(this.colors);
|
|
23184
23357
|
var uvsArray = new Float32Array(this.uvs);
|
|
23185
23358
|
var indicesArray = new Uint16Array(this.indices);
|
|
23186
|
-
this.
|
|
23187
|
-
this.updateAttributeData(VertexBuffer.
|
|
23188
|
-
this.updateAttributeData(VertexBuffer.
|
|
23189
|
-
this.geometry.
|
|
23190
|
-
|
|
23359
|
+
var geometry = this.currentBatchType === "ninePatch" ? this.ninePatchGeometry : this.geometry;
|
|
23360
|
+
this.updateAttributeData(geometry, VertexBuffer.PositionKind, verticesArray, 2);
|
|
23361
|
+
this.updateAttributeData(geometry, VertexBuffer.ColorKind, colorsArray, 4);
|
|
23362
|
+
this.updateAttributeData(geometry, VertexBuffer.UVKind, uvsArray, 2);
|
|
23363
|
+
if (this.currentBatchType === "ninePatch") {
|
|
23364
|
+
this.updateAttributeData(geometry, NINE_PATCH_DRAW_SOURCE_SIZE, new Float32Array(this.ninePatchDrawSourceSizes), 4);
|
|
23365
|
+
this.updateAttributeData(geometry, NINE_PATCH_SOURCE_RECT, new Float32Array(this.ninePatchSourceRects), 4);
|
|
23366
|
+
this.updateAttributeData(geometry, NINE_PATCH_MARGINS, new Float32Array(this.ninePatchMargins), 4);
|
|
23367
|
+
this.updateAttributeData(geometry, NINE_PATCH_OPTIONS, new Float32Array(this.ninePatchOptions), 4);
|
|
23368
|
+
}
|
|
23369
|
+
geometry.setIndexData(indicesArray);
|
|
23370
|
+
geometry.setDrawCount(this.currentIndexCount);
|
|
23191
23371
|
var material;
|
|
23192
|
-
if (this.currentBatchType === "textured" || this.currentBatchType === "text") {
|
|
23193
|
-
material = this.currentBatchType === "text" ? this.textMaterial : this.texturedMaterial;
|
|
23372
|
+
if (this.currentBatchType === "textured" || this.currentBatchType === "text" || this.currentBatchType === "ninePatch") {
|
|
23373
|
+
material = this.currentBatchType === "text" ? this.textMaterial : this.currentBatchType === "ninePatch" ? this.ninePatchMaterial : this.texturedMaterial;
|
|
23194
23374
|
var _this_currentBatchTexture;
|
|
23195
23375
|
var tex = (_this_currentBatchTexture = this.currentBatchTexture) != null ? _this_currentBatchTexture : this.engine.whiteTexture;
|
|
23196
23376
|
material.setTexture("uMainTexture", tex);
|
|
23197
23377
|
} else {
|
|
23198
23378
|
material = this.coloredMaterial;
|
|
23199
23379
|
}
|
|
23200
|
-
this.engine.renderer.drawGeometry(
|
|
23380
|
+
this.engine.renderer.drawGeometry(geometry, Matrix4.IDENTITY, material);
|
|
23201
23381
|
this.indices.length = 0;
|
|
23202
23382
|
this.vertices.length = 0;
|
|
23203
23383
|
this.colors.length = 0;
|
|
23204
23384
|
this.uvs.length = 0;
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23208
|
-
|
|
23385
|
+
this.ninePatchDrawSourceSizes.length = 0;
|
|
23386
|
+
this.ninePatchSourceRects.length = 0;
|
|
23387
|
+
this.ninePatchMargins.length = 0;
|
|
23388
|
+
this.ninePatchOptions.length = 0;
|
|
23389
|
+
};
|
|
23390
|
+
_proto.updateAttributeData = function updateAttributeData(geometry, name, data, size) {
|
|
23391
|
+
var _geometry_getVertexBuffer;
|
|
23392
|
+
var dataBuffer = (_geometry_getVertexBuffer = geometry.getVertexBuffer(name)) == null ? void 0 : _geometry_getVertexBuffer.getBuffer();
|
|
23209
23393
|
if (dataBuffer && data.byteLength > dataBuffer.capacity) {
|
|
23210
|
-
|
|
23394
|
+
geometry.setVerticesBuffer(new VertexBuffer(this.engine, data, name, {
|
|
23211
23395
|
updatable: true,
|
|
23212
23396
|
size: size
|
|
23213
23397
|
}));
|
|
23214
23398
|
return;
|
|
23215
23399
|
}
|
|
23216
|
-
|
|
23400
|
+
geometry.setAttributeData(name, data);
|
|
23217
23401
|
};
|
|
23218
23402
|
/**
|
|
23219
23403
|
* 线段顶点按顺序连接 (p0-p1, p1-p2, p2-p3, ...)
|
|
@@ -23382,10 +23566,37 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23382
23566
|
this.pushQuad(x, y, width, height, color, region);
|
|
23383
23567
|
};
|
|
23384
23568
|
/**
|
|
23569
|
+
* Draws a nine-patch as one quad. Stretching and repetition are resolved in the fragment shader,
|
|
23570
|
+
* so Tile and TileFit do not expand into CPU-side geometry.
|
|
23571
|
+
*/ _proto.drawNinePatch = function drawNinePatch(x, y, width, height, texture, options, color) {
|
|
23572
|
+
if (color === void 0) color = Color.WHITE;
|
|
23573
|
+
if (width <= 0 || height <= 0 || options.sourceWidth <= 0 || options.sourceHeight <= 0) {
|
|
23574
|
+
return;
|
|
23575
|
+
}
|
|
23576
|
+
this.ensureBatch("ninePatch", texture);
|
|
23577
|
+
var sourceU = options.sourceX / texture.width;
|
|
23578
|
+
var sourceV = 1 - options.sourceY / texture.height;
|
|
23579
|
+
var sourceUSize = options.sourceWidth / texture.width;
|
|
23580
|
+
var sourceVSize = options.sourceHeight / texture.height;
|
|
23581
|
+
var _options_horizontalMode;
|
|
23582
|
+
var horizontalMode = (_options_horizontalMode = options.horizontalMode) != null ? _options_horizontalMode : 0;
|
|
23583
|
+
var _options_verticalMode;
|
|
23584
|
+
var verticalMode = (_options_verticalMode = options.verticalMode) != null ? _options_verticalMode : 0;
|
|
23585
|
+
var _options_drawCenter;
|
|
23586
|
+
var drawCenter = Number((_options_drawCenter = options.drawCenter) != null ? _options_drawCenter : true);
|
|
23587
|
+
this.pushQuad(x, y, width, height, color, FULL_REGION);
|
|
23588
|
+
for(var i = 0; i < 4; i++){
|
|
23589
|
+
this.ninePatchDrawSourceSizes.push(width, height, options.sourceWidth, options.sourceHeight);
|
|
23590
|
+
this.ninePatchSourceRects.push(sourceU, sourceV, sourceUSize, sourceVSize);
|
|
23591
|
+
this.ninePatchMargins.push(options.marginLeft, options.marginTop, options.marginRight, options.marginBottom);
|
|
23592
|
+
this.ninePatchOptions.push(horizontalMode, verticalMode, drawCenter, 0);
|
|
23593
|
+
}
|
|
23594
|
+
};
|
|
23595
|
+
/**
|
|
23385
23596
|
* 绘制文本(本地坐标,Y 向下,(x, y) 为文本 cell 左上角)。
|
|
23386
23597
|
*
|
|
23387
23598
|
* 文本走字符级 bitmap atlas(同一字体下每个字只渲染一次,任意文本组合复用 atlas);
|
|
23388
|
-
* `color`
|
|
23599
|
+
* `color` 与 atlas 字形 RGBA 相乘,任意颜色都不会污染 atlas。
|
|
23389
23600
|
*
|
|
23390
23601
|
* 字体参数全部展开,避免调用方每帧创建临时 style 对象触发 GC
|
|
23391
23602
|
* @param x - 文本左上角 X 坐标(首字 ink 起始处,含 padding 的 quad 会向左延伸)
|
|
@@ -23408,10 +23619,11 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23408
23619
|
this.ensureBatch("text", atlas.texture);
|
|
23409
23620
|
var lineHeight = atlas.lineHeight;
|
|
23410
23621
|
var cursorX = x;
|
|
23622
|
+
var characters = Array.from(text);
|
|
23411
23623
|
// ensureChar 可能往 atlas canvas 写新字并打 dirty 标;实际 upload 推迟到
|
|
23412
23624
|
// flushBatch 统一处理,这样一帧多次 drawText 共写同一 atlas 只 upload 一次
|
|
23413
|
-
for(var i = 0; i <
|
|
23414
|
-
var info = atlas.ensureChar(
|
|
23625
|
+
for(var i = 0; i < characters.length; i++){
|
|
23626
|
+
var info = atlas.ensureChar(characters[i]);
|
|
23415
23627
|
if (!info) {
|
|
23416
23628
|
continue;
|
|
23417
23629
|
}
|
|
@@ -23433,11 +23645,35 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23433
23645
|
cursorX += info.advance;
|
|
23434
23646
|
}
|
|
23435
23647
|
};
|
|
23648
|
+
/** Measures text with the same glyph metrics used by {@link drawText}. */ _proto.measureText = function measureText(text, fontSize, fontFamily, fontWeight, fontStyle) {
|
|
23649
|
+
if (fontFamily === void 0) fontFamily = "sans-serif";
|
|
23650
|
+
if (fontWeight === void 0) fontWeight = "normal";
|
|
23651
|
+
if (fontStyle === void 0) fontStyle = "normal";
|
|
23652
|
+
var atlas = this.textCache.getAtlas(fontSize, fontFamily, fontWeight, fontStyle);
|
|
23653
|
+
var characters = Array.from(text);
|
|
23654
|
+
var advances = [];
|
|
23655
|
+
var width = 0;
|
|
23656
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(characters), _step; !(_step = _iterator()).done;){
|
|
23657
|
+
var character = _step.value;
|
|
23658
|
+
var _atlas_ensureChar;
|
|
23659
|
+
var _atlas_ensureChar_advance;
|
|
23660
|
+
var advance = (_atlas_ensureChar_advance = (_atlas_ensureChar = atlas.ensureChar(character)) == null ? void 0 : _atlas_ensureChar.advance) != null ? _atlas_ensureChar_advance : 0;
|
|
23661
|
+
advances.push(advance);
|
|
23662
|
+
width += advance;
|
|
23663
|
+
}
|
|
23664
|
+
return {
|
|
23665
|
+
width: width,
|
|
23666
|
+
lineHeight: atlas.lineHeight,
|
|
23667
|
+
advances: advances
|
|
23668
|
+
};
|
|
23669
|
+
};
|
|
23436
23670
|
_proto.dispose = function dispose() {
|
|
23437
23671
|
this.geometry.dispose();
|
|
23672
|
+
this.ninePatchGeometry.dispose();
|
|
23438
23673
|
this.coloredMaterial.dispose();
|
|
23439
23674
|
this.texturedMaterial.dispose();
|
|
23440
23675
|
this.textMaterial.dispose();
|
|
23676
|
+
this.ninePatchMaterial.dispose();
|
|
23441
23677
|
this.textCache.dispose();
|
|
23442
23678
|
};
|
|
23443
23679
|
_proto.buildShape = function buildShape(shape, color) {
|
|
@@ -23445,7 +23681,7 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23445
23681
|
var indexOffset = this.indices.length;
|
|
23446
23682
|
var vertexOffset = this.vertices.length / 2;
|
|
23447
23683
|
buildPoints.length = 0;
|
|
23448
|
-
shape.build(buildPoints);
|
|
23684
|
+
shape.build(buildPoints, this.getScreenScale());
|
|
23449
23685
|
shape.triangulate(buildPoints, this.vertices, vertexOffset, this.indices, indexOffset);
|
|
23450
23686
|
this.applyTransformAndColor(vertexOffset, this.vertices.length / 2 - vertexOffset, color);
|
|
23451
23687
|
};
|
|
@@ -23455,11 +23691,19 @@ var Graphics = /*#__PURE__*/ function() {
|
|
|
23455
23691
|
this.indices.length;
|
|
23456
23692
|
var vertexOffset = this.vertices.length / 2;
|
|
23457
23693
|
buildPoints.length = 0;
|
|
23458
|
-
shape.build(buildPoints);
|
|
23694
|
+
shape.build(buildPoints, this.getScreenScale());
|
|
23459
23695
|
this.lineStyle.width = thickness;
|
|
23460
23696
|
buildLine(buildPoints, this.lineStyle, false, closed, this.vertices, 2, vertexOffset, this.indices);
|
|
23461
23697
|
this.applyTransformAndColor(vertexOffset, this.vertices.length / 2 - vertexOffset, color);
|
|
23462
23698
|
};
|
|
23699
|
+
_proto.getScreenScale = function getScreenScale() {
|
|
23700
|
+
var transform = this.currentTransform.elements;
|
|
23701
|
+
var transformScaleX = Math.hypot(transform[0], transform[1]);
|
|
23702
|
+
var transformScaleY = Math.hypot(transform[3], transform[4]);
|
|
23703
|
+
var framebufferScaleX = this.engine.canvas.width / this.logicalWidth;
|
|
23704
|
+
var framebufferScaleY = this.engine.canvas.height / this.logicalHeight;
|
|
23705
|
+
return Math.max(transformScaleX * framebufferScaleX, transformScaleY * framebufferScaleY, 1);
|
|
23706
|
+
};
|
|
23463
23707
|
_proto.setTriangleShape = function setTriangleShape(x1, y1, x2, y2, x3, y3) {
|
|
23464
23708
|
this.triangleShape.x = x1;
|
|
23465
23709
|
this.triangleShape.y = y1;
|
|
@@ -24508,2107 +24752,6 @@ FrameComponent = __decorate([
|
|
|
24508
24752
|
// 第四列 (位移) 乘 1,无需修改
|
|
24509
24753
|
}
|
|
24510
24754
|
|
|
24511
|
-
function _assert_this_initialized(self) {
|
|
24512
|
-
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
24513
|
-
return self;
|
|
24514
|
-
}
|
|
24515
|
-
|
|
24516
|
-
var MouseFilter;
|
|
24517
|
-
(function(MouseFilter) {
|
|
24518
|
-
MouseFilter[MouseFilter["Stop"] = 0] = "Stop";
|
|
24519
|
-
MouseFilter[MouseFilter["Pass"] = 1] = "Pass";
|
|
24520
|
-
MouseFilter[MouseFilter["Ignore"] = 2] = "Ignore";
|
|
24521
|
-
})(MouseFilter || (MouseFilter = {}));
|
|
24522
|
-
var MouseBehaviorRecursive;
|
|
24523
|
-
(function(MouseBehaviorRecursive) {
|
|
24524
|
-
MouseBehaviorRecursive[MouseBehaviorRecursive["Inherited"] = 0] = "Inherited";
|
|
24525
|
-
MouseBehaviorRecursive[MouseBehaviorRecursive["Disabled"] = 1] = "Disabled";
|
|
24526
|
-
MouseBehaviorRecursive[MouseBehaviorRecursive["Enabled"] = 2] = "Enabled";
|
|
24527
|
-
})(MouseBehaviorRecursive || (MouseBehaviorRecursive = {}));
|
|
24528
|
-
var MouseButton;
|
|
24529
|
-
(function(MouseButton) {
|
|
24530
|
-
MouseButton[MouseButton["None"] = 0] = "None";
|
|
24531
|
-
MouseButton[MouseButton["Left"] = 1] = "Left";
|
|
24532
|
-
MouseButton[MouseButton["Right"] = 2] = "Right";
|
|
24533
|
-
MouseButton[MouseButton["Middle"] = 3] = "Middle";
|
|
24534
|
-
MouseButton[MouseButton["WheelUp"] = 4] = "WheelUp";
|
|
24535
|
-
MouseButton[MouseButton["WheelDown"] = 5] = "WheelDown";
|
|
24536
|
-
MouseButton[MouseButton["WheelLeft"] = 6] = "WheelLeft";
|
|
24537
|
-
MouseButton[MouseButton["WheelRight"] = 7] = "WheelRight";
|
|
24538
|
-
MouseButton[MouseButton["Xbutton1"] = 8] = "Xbutton1";
|
|
24539
|
-
MouseButton[MouseButton["Xbutton2"] = 9] = "Xbutton2";
|
|
24540
|
-
})(MouseButton || (MouseButton = {}));
|
|
24541
|
-
var MouseButtonMask;
|
|
24542
|
-
(function(MouseButtonMask) {
|
|
24543
|
-
MouseButtonMask[MouseButtonMask["None"] = 0] = "None";
|
|
24544
|
-
MouseButtonMask[MouseButtonMask["Left"] = 1] = "Left";
|
|
24545
|
-
MouseButtonMask[MouseButtonMask["Right"] = 2] = "Right";
|
|
24546
|
-
MouseButtonMask[MouseButtonMask["Middle"] = 4] = "Middle";
|
|
24547
|
-
MouseButtonMask[MouseButtonMask["Xbutton1"] = 128] = "Xbutton1";
|
|
24548
|
-
MouseButtonMask[MouseButtonMask["Xbutton2"] = 256] = "Xbutton2";
|
|
24549
|
-
})(MouseButtonMask || (MouseButtonMask = {}));
|
|
24550
|
-
var FocusMode;
|
|
24551
|
-
(function(FocusMode) {
|
|
24552
|
-
FocusMode[FocusMode["None"] = 0] = "None";
|
|
24553
|
-
FocusMode[FocusMode["Click"] = 1] = "Click";
|
|
24554
|
-
FocusMode[FocusMode["All"] = 2] = "All";
|
|
24555
|
-
FocusMode[FocusMode["Accessibility"] = 3] = "Accessibility";
|
|
24556
|
-
})(FocusMode || (FocusMode = {}));
|
|
24557
|
-
var FocusBehaviorRecursive;
|
|
24558
|
-
(function(FocusBehaviorRecursive) {
|
|
24559
|
-
FocusBehaviorRecursive[FocusBehaviorRecursive["Inherited"] = 0] = "Inherited";
|
|
24560
|
-
FocusBehaviorRecursive[FocusBehaviorRecursive["Disabled"] = 1] = "Disabled";
|
|
24561
|
-
FocusBehaviorRecursive[FocusBehaviorRecursive["Enabled"] = 2] = "Enabled";
|
|
24562
|
-
})(FocusBehaviorRecursive || (FocusBehaviorRecursive = {}));
|
|
24563
|
-
var KeyLocation;
|
|
24564
|
-
(function(KeyLocation) {
|
|
24565
|
-
KeyLocation[KeyLocation["Unspecified"] = 0] = "Unspecified";
|
|
24566
|
-
KeyLocation[KeyLocation["Left"] = 1] = "Left";
|
|
24567
|
-
KeyLocation[KeyLocation["Right"] = 2] = "Right";
|
|
24568
|
-
})(KeyLocation || (KeyLocation = {}));
|
|
24569
|
-
var CursorShape;
|
|
24570
|
-
(function(CursorShape) {
|
|
24571
|
-
CursorShape[CursorShape["Arrow"] = 0] = "Arrow";
|
|
24572
|
-
CursorShape[CursorShape["Ibeam"] = 1] = "Ibeam";
|
|
24573
|
-
CursorShape[CursorShape["PointingHand"] = 2] = "PointingHand";
|
|
24574
|
-
CursorShape[CursorShape["Cross"] = 3] = "Cross";
|
|
24575
|
-
CursorShape[CursorShape["Wait"] = 4] = "Wait";
|
|
24576
|
-
CursorShape[CursorShape["Busy"] = 5] = "Busy";
|
|
24577
|
-
CursorShape[CursorShape["Drag"] = 6] = "Drag";
|
|
24578
|
-
CursorShape[CursorShape["CanDrop"] = 7] = "CanDrop";
|
|
24579
|
-
CursorShape[CursorShape["Forbidden"] = 8] = "Forbidden";
|
|
24580
|
-
CursorShape[CursorShape["Vsize"] = 9] = "Vsize";
|
|
24581
|
-
CursorShape[CursorShape["Hsize"] = 10] = "Hsize";
|
|
24582
|
-
CursorShape[CursorShape["Bdiagsize"] = 11] = "Bdiagsize";
|
|
24583
|
-
CursorShape[CursorShape["Fdiagsize"] = 12] = "Fdiagsize";
|
|
24584
|
-
CursorShape[CursorShape["Move"] = 13] = "Move";
|
|
24585
|
-
CursorShape[CursorShape["Vsplit"] = 14] = "Vsplit";
|
|
24586
|
-
CursorShape[CursorShape["Hsplit"] = 15] = "Hsplit";
|
|
24587
|
-
CursorShape[CursorShape["Help"] = 16] = "Help";
|
|
24588
|
-
})(CursorShape || (CursorShape = {}));
|
|
24589
|
-
|
|
24590
|
-
function _get_prototype_of(o) {
|
|
24591
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
24592
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
24593
|
-
};
|
|
24594
|
-
return _get_prototype_of(o);
|
|
24595
|
-
}
|
|
24596
|
-
|
|
24597
|
-
function _is_native_function(fn) {
|
|
24598
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
24599
|
-
}
|
|
24600
|
-
|
|
24601
|
-
function _wrap_native_super(Class) {
|
|
24602
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
24603
|
-
_wrap_native_super = function _wrap_native_super(Class) {
|
|
24604
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
24605
|
-
if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
24606
|
-
if (typeof _cache !== "undefined") {
|
|
24607
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
24608
|
-
_cache.set(Class, Wrapper);
|
|
24609
|
-
}
|
|
24610
|
-
function Wrapper() {
|
|
24611
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
24612
|
-
}
|
|
24613
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
24614
|
-
constructor: {
|
|
24615
|
-
value: Wrapper,
|
|
24616
|
-
enumerable: false,
|
|
24617
|
-
writable: true,
|
|
24618
|
-
configurable: true
|
|
24619
|
-
}
|
|
24620
|
-
});
|
|
24621
|
-
return _set_prototype_of(Wrapper, Class);
|
|
24622
|
-
};
|
|
24623
|
-
return _wrap_native_super(Class);
|
|
24624
|
-
}
|
|
24625
|
-
|
|
24626
|
-
function transformPoint(transform, value) {
|
|
24627
|
-
var elements = transform.elements;
|
|
24628
|
-
return new Vector2(elements[0] * value.x + elements[3] * value.y + elements[6], elements[1] * value.x + elements[4] * value.y + elements[7]);
|
|
24629
|
-
}
|
|
24630
|
-
function transformVector(transform, value) {
|
|
24631
|
-
var elements = transform.elements;
|
|
24632
|
-
return new Vector2(elements[0] * value.x + elements[3] * value.y, elements[1] * value.x + elements[4] * value.y);
|
|
24633
|
-
}
|
|
24634
|
-
var InputEvent = /*#__PURE__*/ function() {
|
|
24635
|
-
function InputEvent() {
|
|
24636
|
-
this.device = 0;
|
|
24637
|
-
this.pressed = false;
|
|
24638
|
-
this.canceled = false;
|
|
24639
|
-
this._accepted = false;
|
|
24640
|
-
}
|
|
24641
|
-
var _proto = InputEvent.prototype;
|
|
24642
|
-
_proto.accept = function accept() {
|
|
24643
|
-
this._accepted = true;
|
|
24644
|
-
};
|
|
24645
|
-
_proto.clearAccepted = function clearAccepted() {
|
|
24646
|
-
this._accepted = false;
|
|
24647
|
-
};
|
|
24648
|
-
_proto.isAccepted = function isAccepted() {
|
|
24649
|
-
return this._accepted;
|
|
24650
|
-
};
|
|
24651
|
-
_proto.isPressed = function isPressed() {
|
|
24652
|
-
return this.pressed && !this.canceled;
|
|
24653
|
-
};
|
|
24654
|
-
_proto.isReleased = function isReleased() {
|
|
24655
|
-
return !this.pressed && !this.canceled;
|
|
24656
|
-
};
|
|
24657
|
-
_proto.isCanceled = function isCanceled() {
|
|
24658
|
-
return this.canceled;
|
|
24659
|
-
};
|
|
24660
|
-
_proto.isEcho = function isEcho() {
|
|
24661
|
-
return false;
|
|
24662
|
-
};
|
|
24663
|
-
_proto.xformedBy = function xformedBy(transform) {
|
|
24664
|
-
return this;
|
|
24665
|
-
};
|
|
24666
|
-
return InputEvent;
|
|
24667
|
-
}();
|
|
24668
|
-
InputEvent.deviceIdEmulation = -1;
|
|
24669
|
-
InputEvent.deviceIdInternal = -2;
|
|
24670
|
-
InputEvent.deviceIdKeyboard = 16;
|
|
24671
|
-
InputEvent.deviceIdMouse = 32;
|
|
24672
|
-
var InputEventWithModifiers = /*#__PURE__*/ function(InputEvent) {
|
|
24673
|
-
_inherits(InputEventWithModifiers, InputEvent);
|
|
24674
|
-
function InputEventWithModifiers() {
|
|
24675
|
-
var _this;
|
|
24676
|
-
_this = InputEvent.apply(this, arguments) || this;
|
|
24677
|
-
_this.commandOrControlAutoremap = false;
|
|
24678
|
-
_this.shiftPressed = false;
|
|
24679
|
-
_this.altPressed = false;
|
|
24680
|
-
_this.metaPressed = false;
|
|
24681
|
-
_this.ctrlPressed = false;
|
|
24682
|
-
return _this;
|
|
24683
|
-
}
|
|
24684
|
-
var _proto = InputEventWithModifiers.prototype;
|
|
24685
|
-
_proto.copyModifiersTo = function copyModifiersTo(event) {
|
|
24686
|
-
event.device = this.device;
|
|
24687
|
-
event.pressed = this.pressed;
|
|
24688
|
-
event.canceled = this.canceled;
|
|
24689
|
-
event.commandOrControlAutoremap = this.commandOrControlAutoremap;
|
|
24690
|
-
event.shiftPressed = this.shiftPressed;
|
|
24691
|
-
event.altPressed = this.altPressed;
|
|
24692
|
-
event.metaPressed = this.metaPressed;
|
|
24693
|
-
event.ctrlPressed = this.ctrlPressed;
|
|
24694
|
-
};
|
|
24695
|
-
return InputEventWithModifiers;
|
|
24696
|
-
}(_wrap_native_super(InputEvent));
|
|
24697
|
-
var InputEventKey = /*#__PURE__*/ function(InputEventWithModifiers) {
|
|
24698
|
-
_inherits(InputEventKey, InputEventWithModifiers);
|
|
24699
|
-
function InputEventKey() {
|
|
24700
|
-
var _this;
|
|
24701
|
-
_this = InputEventWithModifiers.apply(this, arguments) || this;
|
|
24702
|
-
_this.keycode = "";
|
|
24703
|
-
_this.physicalKeycode = "";
|
|
24704
|
-
_this.keyLabel = "";
|
|
24705
|
-
_this.unicode = 0;
|
|
24706
|
-
_this.location = KeyLocation.Unspecified;
|
|
24707
|
-
_this.echo = false;
|
|
24708
|
-
return _this;
|
|
24709
|
-
}
|
|
24710
|
-
var _proto = InputEventKey.prototype;
|
|
24711
|
-
_proto.isEcho = function isEcho() {
|
|
24712
|
-
return this.echo;
|
|
24713
|
-
};
|
|
24714
|
-
return InputEventKey;
|
|
24715
|
-
}(InputEventWithModifiers);
|
|
24716
|
-
var InputEventMouse = /*#__PURE__*/ function(InputEventWithModifiers) {
|
|
24717
|
-
_inherits(InputEventMouse, InputEventWithModifiers);
|
|
24718
|
-
function InputEventMouse() {
|
|
24719
|
-
var _this;
|
|
24720
|
-
_this = InputEventWithModifiers.apply(this, arguments) || this;
|
|
24721
|
-
_this.buttonMask = MouseButtonMask.None;
|
|
24722
|
-
_this.position = new Vector2();
|
|
24723
|
-
_this.globalPosition = new Vector2();
|
|
24724
|
-
return _this;
|
|
24725
|
-
}
|
|
24726
|
-
var _proto = InputEventMouse.prototype;
|
|
24727
|
-
_proto.copyMouseTo = function copyMouseTo(event) {
|
|
24728
|
-
this.copyModifiersTo(event);
|
|
24729
|
-
event.buttonMask = this.buttonMask;
|
|
24730
|
-
event.position.copyFrom(this.position);
|
|
24731
|
-
event.globalPosition.copyFrom(this.globalPosition);
|
|
24732
|
-
};
|
|
24733
|
-
return InputEventMouse;
|
|
24734
|
-
}(InputEventWithModifiers);
|
|
24735
|
-
var InputEventMouseButton = /*#__PURE__*/ function(InputEventMouse) {
|
|
24736
|
-
_inherits(InputEventMouseButton, InputEventMouse);
|
|
24737
|
-
function InputEventMouseButton() {
|
|
24738
|
-
var _this;
|
|
24739
|
-
_this = InputEventMouse.apply(this, arguments) || this;
|
|
24740
|
-
_this.factor = 1;
|
|
24741
|
-
_this.buttonIndex = MouseButton.None;
|
|
24742
|
-
_this.doubleClick = false;
|
|
24743
|
-
return _this;
|
|
24744
|
-
}
|
|
24745
|
-
var _proto = InputEventMouseButton.prototype;
|
|
24746
|
-
_proto.xformedBy = function xformedBy(transform) {
|
|
24747
|
-
var event = new InputEventMouseButton();
|
|
24748
|
-
this.copyMouseTo(event);
|
|
24749
|
-
event.position.copyFrom(transformPoint(transform, this.position));
|
|
24750
|
-
event.factor = this.factor;
|
|
24751
|
-
event.buttonIndex = this.buttonIndex;
|
|
24752
|
-
event.doubleClick = this.doubleClick;
|
|
24753
|
-
return event;
|
|
24754
|
-
};
|
|
24755
|
-
return InputEventMouseButton;
|
|
24756
|
-
}(InputEventMouse);
|
|
24757
|
-
var InputEventMouseMotion = /*#__PURE__*/ function(InputEventMouse) {
|
|
24758
|
-
_inherits(InputEventMouseMotion, InputEventMouse);
|
|
24759
|
-
function InputEventMouseMotion() {
|
|
24760
|
-
var _this;
|
|
24761
|
-
_this = InputEventMouse.apply(this, arguments) || this;
|
|
24762
|
-
_this.tilt = new Vector2();
|
|
24763
|
-
_this.pressure = 0;
|
|
24764
|
-
_this.relative = new Vector2();
|
|
24765
|
-
_this.screenRelative = new Vector2();
|
|
24766
|
-
_this.velocity = new Vector2();
|
|
24767
|
-
_this.screenVelocity = new Vector2();
|
|
24768
|
-
_this.penInverted = false;
|
|
24769
|
-
return _this;
|
|
24770
|
-
}
|
|
24771
|
-
var _proto = InputEventMouseMotion.prototype;
|
|
24772
|
-
_proto.xformedBy = function xformedBy(transform) {
|
|
24773
|
-
var event = new InputEventMouseMotion();
|
|
24774
|
-
this.copyMouseTo(event);
|
|
24775
|
-
event.position.copyFrom(transformPoint(transform, this.position));
|
|
24776
|
-
event.tilt.copyFrom(this.tilt);
|
|
24777
|
-
event.pressure = this.pressure;
|
|
24778
|
-
event.relative.copyFrom(transformVector(transform, this.relative));
|
|
24779
|
-
event.screenRelative.copyFrom(this.screenRelative);
|
|
24780
|
-
event.velocity.copyFrom(transformVector(transform, this.velocity));
|
|
24781
|
-
event.screenVelocity.copyFrom(this.screenVelocity);
|
|
24782
|
-
event.penInverted = this.penInverted;
|
|
24783
|
-
return event;
|
|
24784
|
-
};
|
|
24785
|
-
return InputEventMouseMotion;
|
|
24786
|
-
}(InputEventMouse);
|
|
24787
|
-
var InputEventScreenTouch = /*#__PURE__*/ function(InputEvent) {
|
|
24788
|
-
_inherits(InputEventScreenTouch, InputEvent);
|
|
24789
|
-
function InputEventScreenTouch() {
|
|
24790
|
-
var _this;
|
|
24791
|
-
_this = InputEvent.apply(this, arguments) || this;
|
|
24792
|
-
_this.index = 0;
|
|
24793
|
-
_this.position = new Vector2();
|
|
24794
|
-
_this.doubleTap = false;
|
|
24795
|
-
return _this;
|
|
24796
|
-
}
|
|
24797
|
-
var _proto = InputEventScreenTouch.prototype;
|
|
24798
|
-
_proto.xformedBy = function xformedBy(transform) {
|
|
24799
|
-
var event = new InputEventScreenTouch();
|
|
24800
|
-
event.device = this.device;
|
|
24801
|
-
event.pressed = this.pressed;
|
|
24802
|
-
event.canceled = this.canceled;
|
|
24803
|
-
event.index = this.index;
|
|
24804
|
-
event.position.copyFrom(transformPoint(transform, this.position));
|
|
24805
|
-
event.doubleTap = this.doubleTap;
|
|
24806
|
-
return event;
|
|
24807
|
-
};
|
|
24808
|
-
return InputEventScreenTouch;
|
|
24809
|
-
}(_wrap_native_super(InputEvent));
|
|
24810
|
-
var InputEventScreenDrag = /*#__PURE__*/ function(InputEvent) {
|
|
24811
|
-
_inherits(InputEventScreenDrag, InputEvent);
|
|
24812
|
-
function InputEventScreenDrag() {
|
|
24813
|
-
var _this;
|
|
24814
|
-
_this = InputEvent.apply(this, arguments) || this;
|
|
24815
|
-
_this.index = 0;
|
|
24816
|
-
_this.position = new Vector2();
|
|
24817
|
-
_this.relative = new Vector2();
|
|
24818
|
-
_this.screenRelative = new Vector2();
|
|
24819
|
-
_this.velocity = new Vector2();
|
|
24820
|
-
_this.screenVelocity = new Vector2();
|
|
24821
|
-
_this.pressure = 0;
|
|
24822
|
-
_this.tilt = new Vector2();
|
|
24823
|
-
_this.penInverted = false;
|
|
24824
|
-
return _this;
|
|
24825
|
-
}
|
|
24826
|
-
var _proto = InputEventScreenDrag.prototype;
|
|
24827
|
-
_proto.xformedBy = function xformedBy(transform) {
|
|
24828
|
-
var event = new InputEventScreenDrag();
|
|
24829
|
-
event.device = this.device;
|
|
24830
|
-
event.pressed = this.pressed;
|
|
24831
|
-
event.canceled = this.canceled;
|
|
24832
|
-
event.index = this.index;
|
|
24833
|
-
event.position.copyFrom(transformPoint(transform, this.position));
|
|
24834
|
-
event.relative.copyFrom(transformVector(transform, this.relative));
|
|
24835
|
-
event.screenRelative.copyFrom(this.screenRelative);
|
|
24836
|
-
event.velocity.copyFrom(transformVector(transform, this.velocity));
|
|
24837
|
-
event.screenVelocity.copyFrom(this.screenVelocity);
|
|
24838
|
-
event.pressure = this.pressure;
|
|
24839
|
-
event.tilt.copyFrom(this.tilt);
|
|
24840
|
-
event.penInverted = this.penInverted;
|
|
24841
|
-
return event;
|
|
24842
|
-
};
|
|
24843
|
-
return InputEventScreenDrag;
|
|
24844
|
-
}(_wrap_native_super(InputEvent));
|
|
24845
|
-
|
|
24846
|
-
var ANCHOR_PRESET_TABLE = {
|
|
24847
|
-
topLeft: [
|
|
24848
|
-
0,
|
|
24849
|
-
0,
|
|
24850
|
-
0,
|
|
24851
|
-
0
|
|
24852
|
-
],
|
|
24853
|
-
topRight: [
|
|
24854
|
-
1,
|
|
24855
|
-
0,
|
|
24856
|
-
1,
|
|
24857
|
-
0
|
|
24858
|
-
],
|
|
24859
|
-
bottomLeft: [
|
|
24860
|
-
0,
|
|
24861
|
-
1,
|
|
24862
|
-
0,
|
|
24863
|
-
1
|
|
24864
|
-
],
|
|
24865
|
-
bottomRight: [
|
|
24866
|
-
1,
|
|
24867
|
-
1,
|
|
24868
|
-
1,
|
|
24869
|
-
1
|
|
24870
|
-
],
|
|
24871
|
-
centerLeft: [
|
|
24872
|
-
0,
|
|
24873
|
-
0.5,
|
|
24874
|
-
0,
|
|
24875
|
-
0.5
|
|
24876
|
-
],
|
|
24877
|
-
centerTop: [
|
|
24878
|
-
0.5,
|
|
24879
|
-
0,
|
|
24880
|
-
0.5,
|
|
24881
|
-
0
|
|
24882
|
-
],
|
|
24883
|
-
centerRight: [
|
|
24884
|
-
1,
|
|
24885
|
-
0.5,
|
|
24886
|
-
1,
|
|
24887
|
-
0.5
|
|
24888
|
-
],
|
|
24889
|
-
centerBottom: [
|
|
24890
|
-
0.5,
|
|
24891
|
-
1,
|
|
24892
|
-
0.5,
|
|
24893
|
-
1
|
|
24894
|
-
],
|
|
24895
|
-
center: [
|
|
24896
|
-
0.5,
|
|
24897
|
-
0.5,
|
|
24898
|
-
0.5,
|
|
24899
|
-
0.5
|
|
24900
|
-
],
|
|
24901
|
-
leftWide: [
|
|
24902
|
-
0,
|
|
24903
|
-
0,
|
|
24904
|
-
0,
|
|
24905
|
-
1
|
|
24906
|
-
],
|
|
24907
|
-
topWide: [
|
|
24908
|
-
0,
|
|
24909
|
-
0,
|
|
24910
|
-
1,
|
|
24911
|
-
0
|
|
24912
|
-
],
|
|
24913
|
-
rightWide: [
|
|
24914
|
-
1,
|
|
24915
|
-
0,
|
|
24916
|
-
1,
|
|
24917
|
-
1
|
|
24918
|
-
],
|
|
24919
|
-
bottomWide: [
|
|
24920
|
-
0,
|
|
24921
|
-
1,
|
|
24922
|
-
1,
|
|
24923
|
-
1
|
|
24924
|
-
],
|
|
24925
|
-
vcenterWide: [
|
|
24926
|
-
0.5,
|
|
24927
|
-
0,
|
|
24928
|
-
0.5,
|
|
24929
|
-
1
|
|
24930
|
-
],
|
|
24931
|
-
hcenterWide: [
|
|
24932
|
-
0,
|
|
24933
|
-
0.5,
|
|
24934
|
-
1,
|
|
24935
|
-
0.5
|
|
24936
|
-
],
|
|
24937
|
-
fullRect: [
|
|
24938
|
-
0,
|
|
24939
|
-
0,
|
|
24940
|
-
1,
|
|
24941
|
-
1
|
|
24942
|
-
]
|
|
24943
|
-
};
|
|
24944
|
-
/**
|
|
24945
|
-
* A drawable GUI object. Controls form a tree independent from the VFXItem
|
|
24946
|
-
* scene tree. UIControl is the bridge between both trees.
|
|
24947
|
-
*/ var Control = /*#__PURE__*/ function() {
|
|
24948
|
-
function Control(engine) {
|
|
24949
|
-
this.engine = engine;
|
|
24950
|
-
this._parent = null;
|
|
24951
|
-
this._visible = true;
|
|
24952
|
-
this._enabled = true;
|
|
24953
|
-
this._mouseFilter = MouseFilter.Stop;
|
|
24954
|
-
this._mouseBehaviorRecursive = MouseBehaviorRecursive.Inherited;
|
|
24955
|
-
this._focusMode = FocusMode.None;
|
|
24956
|
-
this._focusBehaviorRecursive = FocusBehaviorRecursive.Inherited;
|
|
24957
|
-
this._defaultCursorShape = CursorShape.Arrow;
|
|
24958
|
-
this._rotation = 0;
|
|
24959
|
-
this.transformDirty = true;
|
|
24960
|
-
this.cachedTransform = new Matrix3();
|
|
24961
|
-
this.eventEmitter = new EventEmitter();
|
|
24962
|
-
this.disposed = false;
|
|
24963
|
-
this./** Scene-tree bridge that owns this GUI object, if any. */ owner = null;
|
|
24964
|
-
this.position = new Vector2();
|
|
24965
|
-
this.size = new Vector2(1, 1);
|
|
24966
|
-
this.anchorMin = new Vector2();
|
|
24967
|
-
this.anchorMax = new Vector2();
|
|
24968
|
-
this.offsetMin = new Vector2();
|
|
24969
|
-
this.offsetMax = new Vector2(1, 1);
|
|
24970
|
-
this.pivot = new Vector2(0.5, 0.5);
|
|
24971
|
-
this.scale = new Vector2(1, 1);
|
|
24972
|
-
this.shear = new Vector2();
|
|
24973
|
-
this.mouseForcePassScrollEvents = true;
|
|
24974
|
-
this.clipContents = false;
|
|
24975
|
-
}
|
|
24976
|
-
var _proto = Control.prototype;
|
|
24977
|
-
_proto.on = function on(eventName, listener, options) {
|
|
24978
|
-
this.eventEmitter.on(eventName, listener, options);
|
|
24979
|
-
};
|
|
24980
|
-
_proto.off = function off(eventName, listener) {
|
|
24981
|
-
this.eventEmitter.off(eventName, listener);
|
|
24982
|
-
};
|
|
24983
|
-
_proto.setPosition = function setPosition(x, y, keepOffsets) {
|
|
24984
|
-
if (keepOffsets === void 0) keepOffsets = false;
|
|
24985
|
-
if (this.position.x === x && this.position.y === y) {
|
|
24986
|
-
return;
|
|
24987
|
-
}
|
|
24988
|
-
var rect = {
|
|
24989
|
-
position: new Vector2(x, y),
|
|
24990
|
-
size: this.size.clone()
|
|
24991
|
-
};
|
|
24992
|
-
if (keepOffsets && this.parent) {
|
|
24993
|
-
this.computeAnchors(rect, this.getParentRect());
|
|
24994
|
-
} else {
|
|
24995
|
-
this.computeOffsets(rect, this.getParentRect());
|
|
24996
|
-
}
|
|
24997
|
-
this.updateLayout();
|
|
24998
|
-
};
|
|
24999
|
-
_proto.setSize = function setSize(width, height) {
|
|
25000
|
-
if (this.size.x === width && this.size.y === height) {
|
|
25001
|
-
return;
|
|
25002
|
-
}
|
|
25003
|
-
var rect = {
|
|
25004
|
-
position: this.position.clone(),
|
|
25005
|
-
size: new Vector2(width, height)
|
|
25006
|
-
};
|
|
25007
|
-
this.computeOffsets(rect, this.getParentRect());
|
|
25008
|
-
this.updateLayout();
|
|
25009
|
-
};
|
|
25010
|
-
_proto.setScale = function setScale(x, y) {
|
|
25011
|
-
if (this.scale.x !== x || this.scale.y !== y) {
|
|
25012
|
-
this.scale.set(x, y);
|
|
25013
|
-
this.markTransformDirty();
|
|
25014
|
-
}
|
|
25015
|
-
};
|
|
25016
|
-
_proto.setRotation = function setRotation(degrees) {
|
|
25017
|
-
if (this._rotation !== degrees) {
|
|
25018
|
-
this._rotation = degrees;
|
|
25019
|
-
this.markTransformDirty();
|
|
25020
|
-
}
|
|
25021
|
-
};
|
|
25022
|
-
_proto.setShear = function setShear(x, y) {
|
|
25023
|
-
if (this.shear.x !== x || this.shear.y !== y) {
|
|
25024
|
-
this.shear.set(x, y);
|
|
25025
|
-
this.markTransformDirty();
|
|
25026
|
-
}
|
|
25027
|
-
};
|
|
25028
|
-
_proto.setPivot = function setPivot(x, y) {
|
|
25029
|
-
if (this.pivot.x !== x || this.pivot.y !== y) {
|
|
25030
|
-
this.pivot.set(x, y);
|
|
25031
|
-
this.markTransformDirty();
|
|
25032
|
-
}
|
|
25033
|
-
};
|
|
25034
|
-
_proto.setAnchorMin = function setAnchorMin(x, y) {
|
|
25035
|
-
if (this.anchorMin.x !== x || this.anchorMin.y !== y) {
|
|
25036
|
-
this.anchorMin.set(x, y);
|
|
25037
|
-
this.updateLayout();
|
|
25038
|
-
}
|
|
25039
|
-
};
|
|
25040
|
-
_proto.setAnchorMax = function setAnchorMax(x, y) {
|
|
25041
|
-
if (this.anchorMax.x !== x || this.anchorMax.y !== y) {
|
|
25042
|
-
this.anchorMax.set(x, y);
|
|
25043
|
-
this.updateLayout();
|
|
25044
|
-
}
|
|
25045
|
-
};
|
|
25046
|
-
_proto.setOffsetMin = function setOffsetMin(x, y) {
|
|
25047
|
-
if (this.offsetMin.x !== x || this.offsetMin.y !== y) {
|
|
25048
|
-
this.offsetMin.set(x, y);
|
|
25049
|
-
this.updateLayout();
|
|
25050
|
-
}
|
|
25051
|
-
};
|
|
25052
|
-
_proto.setOffsetMax = function setOffsetMax(x, y) {
|
|
25053
|
-
if (this.offsetMax.x !== x || this.offsetMax.y !== y) {
|
|
25054
|
-
this.offsetMax.set(x, y);
|
|
25055
|
-
this.updateLayout();
|
|
25056
|
-
}
|
|
25057
|
-
};
|
|
25058
|
-
_proto.getRect = function getRect() {
|
|
25059
|
-
return {
|
|
25060
|
-
position: this.position.clone(),
|
|
25061
|
-
size: this.size.clone()
|
|
25062
|
-
};
|
|
25063
|
-
};
|
|
25064
|
-
_proto.getTransform2D = function getTransform2D() {
|
|
25065
|
-
if (this.transformDirty) {
|
|
25066
|
-
var radians = this._rotation * Math.PI / 180;
|
|
25067
|
-
var sin = Math.sin(radians);
|
|
25068
|
-
var cos = Math.cos(radians);
|
|
25069
|
-
var shearX = Math.tan(Math.max(-89, Math.min(89, this.shear.x)) * Math.PI / 180);
|
|
25070
|
-
var shearY = Math.tan(Math.max(-89, Math.min(89, this.shear.y)) * Math.PI / 180);
|
|
25071
|
-
var a = this.scale.x * (cos - sin * shearY);
|
|
25072
|
-
var b = this.scale.x * (sin + cos * shearY);
|
|
25073
|
-
var c = this.scale.y * (cos * shearX - sin);
|
|
25074
|
-
var d = this.scale.y * (sin * shearX + cos);
|
|
25075
|
-
var pivotX = this.pivot.x * this.size.x;
|
|
25076
|
-
var pivotY = this.pivot.y * this.size.y;
|
|
25077
|
-
var tx = this.position.x + pivotX - a * pivotX - c * pivotY;
|
|
25078
|
-
var ty = this.position.y + pivotY - b * pivotX - d * pivotY;
|
|
25079
|
-
this.cachedTransform.set(a, b, 0, c, d, 0, tx, ty, 1);
|
|
25080
|
-
this.transformDirty = false;
|
|
25081
|
-
}
|
|
25082
|
-
return this.cachedTransform;
|
|
25083
|
-
};
|
|
25084
|
-
_proto.setAnchorsPreset = function setAnchorsPreset(preset, keepOffsets) {
|
|
25085
|
-
if (keepOffsets === void 0) keepOffsets = true;
|
|
25086
|
-
var _ANCHOR_PRESET_TABLE_preset = ANCHOR_PRESET_TABLE[preset], minX = _ANCHOR_PRESET_TABLE_preset[0], minY = _ANCHOR_PRESET_TABLE_preset[1], maxX = _ANCHOR_PRESET_TABLE_preset[2], maxY = _ANCHOR_PRESET_TABLE_preset[3];
|
|
25087
|
-
if (keepOffsets) {
|
|
25088
|
-
this.anchorMin.set(minX, minY);
|
|
25089
|
-
this.anchorMax.set(maxX, maxY);
|
|
25090
|
-
} else {
|
|
25091
|
-
var rect = this.getRect();
|
|
25092
|
-
this.anchorMin.set(minX, minY);
|
|
25093
|
-
this.anchorMax.set(maxX, maxY);
|
|
25094
|
-
this.computeOffsets(rect, this.getParentRect());
|
|
25095
|
-
}
|
|
25096
|
-
this.updateLayout();
|
|
25097
|
-
};
|
|
25098
|
-
_proto.setOffsetsPreset = function setOffsetsPreset(preset, margin) {
|
|
25099
|
-
if (margin === void 0) margin = 0;
|
|
25100
|
-
if (!this.parent) {
|
|
25101
|
-
return;
|
|
25102
|
-
}
|
|
25103
|
-
var parentSize = this.parent.size;
|
|
25104
|
-
var width = this.size.x;
|
|
25105
|
-
var height = this.size.y;
|
|
25106
|
-
var a = this.anchorMin;
|
|
25107
|
-
var b = this.anchorMax;
|
|
25108
|
-
var minX = 0, maxX = 0, minY = 0, maxY = 0;
|
|
25109
|
-
// Left edge.
|
|
25110
|
-
switch(preset){
|
|
25111
|
-
case "topLeft":
|
|
25112
|
-
case "bottomLeft":
|
|
25113
|
-
case "centerLeft":
|
|
25114
|
-
case "topWide":
|
|
25115
|
-
case "bottomWide":
|
|
25116
|
-
case "leftWide":
|
|
25117
|
-
case "hcenterWide":
|
|
25118
|
-
case "fullRect":
|
|
25119
|
-
minX = margin - a.x * parentSize.x;
|
|
25120
|
-
break;
|
|
25121
|
-
case "centerTop":
|
|
25122
|
-
case "centerBottom":
|
|
25123
|
-
case "center":
|
|
25124
|
-
case "vcenterWide":
|
|
25125
|
-
minX = 0.5 * parentSize.x - width / 2 - a.x * parentSize.x;
|
|
25126
|
-
break;
|
|
25127
|
-
default:
|
|
25128
|
-
minX = parentSize.x - margin - width - a.x * parentSize.x;
|
|
25129
|
-
break;
|
|
25130
|
-
}
|
|
25131
|
-
switch(preset){
|
|
25132
|
-
case "topLeft":
|
|
25133
|
-
case "bottomLeft":
|
|
25134
|
-
case "centerLeft":
|
|
25135
|
-
case "leftWide":
|
|
25136
|
-
maxX = margin + width - b.x * parentSize.x;
|
|
25137
|
-
break;
|
|
25138
|
-
case "centerTop":
|
|
25139
|
-
case "centerBottom":
|
|
25140
|
-
case "center":
|
|
25141
|
-
case "vcenterWide":
|
|
25142
|
-
maxX = 0.5 * parentSize.x + width / 2 - b.x * parentSize.x;
|
|
25143
|
-
break;
|
|
25144
|
-
default:
|
|
25145
|
-
maxX = parentSize.x - margin - b.x * parentSize.x;
|
|
25146
|
-
break;
|
|
25147
|
-
}
|
|
25148
|
-
// Top edge.
|
|
25149
|
-
switch(preset){
|
|
25150
|
-
case "topLeft":
|
|
25151
|
-
case "topRight":
|
|
25152
|
-
case "centerTop":
|
|
25153
|
-
case "leftWide":
|
|
25154
|
-
case "rightWide":
|
|
25155
|
-
case "topWide":
|
|
25156
|
-
case "vcenterWide":
|
|
25157
|
-
case "fullRect":
|
|
25158
|
-
minY = margin - a.y * parentSize.y;
|
|
25159
|
-
break;
|
|
25160
|
-
case "centerLeft":
|
|
25161
|
-
case "centerRight":
|
|
25162
|
-
case "center":
|
|
25163
|
-
case "hcenterWide":
|
|
25164
|
-
minY = 0.5 * parentSize.y - height / 2 - a.y * parentSize.y;
|
|
25165
|
-
break;
|
|
25166
|
-
default:
|
|
25167
|
-
minY = parentSize.y - margin - height - a.y * parentSize.y;
|
|
25168
|
-
break;
|
|
25169
|
-
}
|
|
25170
|
-
// Bottom edge.
|
|
25171
|
-
switch(preset){
|
|
25172
|
-
case "topLeft":
|
|
25173
|
-
case "topRight":
|
|
25174
|
-
case "centerTop":
|
|
25175
|
-
case "topWide":
|
|
25176
|
-
maxY = margin + height - b.y * parentSize.y;
|
|
25177
|
-
break;
|
|
25178
|
-
case "centerLeft":
|
|
25179
|
-
case "centerRight":
|
|
25180
|
-
case "center":
|
|
25181
|
-
case "hcenterWide":
|
|
25182
|
-
maxY = 0.5 * parentSize.y + height / 2 - b.y * parentSize.y;
|
|
25183
|
-
break;
|
|
25184
|
-
default:
|
|
25185
|
-
maxY = parentSize.y - margin - b.y * parentSize.y;
|
|
25186
|
-
break;
|
|
25187
|
-
}
|
|
25188
|
-
this.offsetMin.set(minX, minY);
|
|
25189
|
-
this.offsetMax.set(maxX, maxY);
|
|
25190
|
-
this.updateLayout();
|
|
25191
|
-
};
|
|
25192
|
-
_proto.setAnchorsAndOffsetsPreset = function setAnchorsAndOffsetsPreset(preset, margin) {
|
|
25193
|
-
if (margin === void 0) margin = 0;
|
|
25194
|
-
this.setAnchorsPreset(preset, false);
|
|
25195
|
-
this.setOffsetsPreset(preset, margin);
|
|
25196
|
-
};
|
|
25197
|
-
_proto.getGlobalTransform2D = function getGlobalTransform2D() {
|
|
25198
|
-
var local = this.getTransform2D();
|
|
25199
|
-
return this.parent ? new Matrix3().multiplyMatrices(this.parent.getGlobalTransform2D(), local) : local.clone();
|
|
25200
|
-
};
|
|
25201
|
-
_proto.hasPoint = function hasPoint(point) {
|
|
25202
|
-
return point.x >= 0 && point.y >= 0 && point.x <= this.size.x && point.y <= this.size.y;
|
|
25203
|
-
};
|
|
25204
|
-
_proto.getEffectiveMouseFilter = function getEffectiveMouseFilter() {
|
|
25205
|
-
return this.enabledInHierarchy && this.isMouseRecursiveEnabled() ? this.mouseFilter : MouseFilter.Ignore;
|
|
25206
|
-
};
|
|
25207
|
-
_proto.getFocusModeWithOverride = function getFocusModeWithOverride() {
|
|
25208
|
-
return this.enabledInHierarchy && this.isFocusRecursiveEnabled() ? this.focusMode : FocusMode.None;
|
|
25209
|
-
};
|
|
25210
|
-
_proto.getCursorShape = function getCursorShape(position) {
|
|
25211
|
-
return this.defaultCursorShape;
|
|
25212
|
-
};
|
|
25213
|
-
_proto.focus = function focus() {
|
|
25214
|
-
var _this_root;
|
|
25215
|
-
(_this_root = this.root) == null ? void 0 : _this_root.grabControlFocus(this);
|
|
25216
|
-
};
|
|
25217
|
-
_proto.grabFocus = function grabFocus() {
|
|
25218
|
-
this.focus();
|
|
25219
|
-
};
|
|
25220
|
-
_proto.grabClickFocus = function grabClickFocus() {
|
|
25221
|
-
var _this_root;
|
|
25222
|
-
(_this_root = this.root) == null ? void 0 : _this_root.grabControlClickFocus(this);
|
|
25223
|
-
};
|
|
25224
|
-
_proto.releaseFocus = function releaseFocus() {
|
|
25225
|
-
var _this_root;
|
|
25226
|
-
(_this_root = this.root) == null ? void 0 : _this_root.releaseControlFocus(this);
|
|
25227
|
-
};
|
|
25228
|
-
_proto.warpMouse = function warpMouse(position) {
|
|
25229
|
-
var _this_root;
|
|
25230
|
-
var matrix = this.getGlobalTransform2D().elements;
|
|
25231
|
-
(_this_root = this.root) == null ? void 0 : _this_root.warpControlMouse(new Vector2(matrix[0] * position.x + matrix[3] * position.y + matrix[6], matrix[1] * position.x + matrix[4] * position.y + matrix[7]));
|
|
25232
|
-
};
|
|
25233
|
-
/** Converts a window-space position into this control's local coordinates. */ _proto.makePositionLocal = function makePositionLocal(position) {
|
|
25234
|
-
var transform = this.getGlobalTransform2D().clone();
|
|
25235
|
-
if (Math.abs(transform.determinant()) < 1e-12) {
|
|
25236
|
-
return new Vector2();
|
|
25237
|
-
}
|
|
25238
|
-
var elements = transform.invert().elements;
|
|
25239
|
-
return new Vector2(elements[0] * position.x + elements[3] * position.y + elements[6], elements[1] * position.x + elements[4] * position.y + elements[7]);
|
|
25240
|
-
};
|
|
25241
|
-
/** Gets the current mouse position transformed into this control's coordinates. */ _proto.getLocalMousePosition = function getLocalMousePosition() {
|
|
25242
|
-
var root = this.root;
|
|
25243
|
-
return root ? this.makePositionLocal(root.getMousePosition()) : new Vector2();
|
|
25244
|
-
};
|
|
25245
|
-
_proto.update = function update(deltaTime) {};
|
|
25246
|
-
_proto.draw = function draw() {
|
|
25247
|
-
// OVERRIDE
|
|
25248
|
-
};
|
|
25249
|
-
_proto.onDestroy = function onDestroy() {};
|
|
25250
|
-
/** @internal */ _proto.drawInternal = function drawInternal() {
|
|
25251
|
-
if (!this.visibleInHierarchy || this.disposed) {
|
|
25252
|
-
return;
|
|
25253
|
-
}
|
|
25254
|
-
var graphics = this.engine.graphics;
|
|
25255
|
-
graphics.pushTransform(this.getTransform2D());
|
|
25256
|
-
this.draw();
|
|
25257
|
-
graphics.popTransform();
|
|
25258
|
-
};
|
|
25259
|
-
_proto.drawLine = function drawLine(x1, y1, x2, y2, color, thickness) {
|
|
25260
|
-
this.engine.graphics.drawLine(x1, y1, x2, y2, color, thickness);
|
|
25261
|
-
};
|
|
25262
|
-
_proto.drawPolyline = function drawPolyline(points, color, thickness) {
|
|
25263
|
-
this.engine.graphics.drawLines(points, color, thickness);
|
|
25264
|
-
};
|
|
25265
|
-
_proto.drawBezier = function drawBezier(x1, y1, x2, y2, x3, y3, x4, y4, color, thickness) {
|
|
25266
|
-
this.engine.graphics.drawBezier(x1, y1, x2, y2, x3, y3, x4, y4, color, thickness);
|
|
25267
|
-
};
|
|
25268
|
-
_proto.drawTriangle = function drawTriangle(x1, y1, x2, y2, x3, y3, color, thickness) {
|
|
25269
|
-
this.engine.graphics.drawTriangle(x1, y1, x2, y2, x3, y3, color, thickness);
|
|
25270
|
-
};
|
|
25271
|
-
_proto.drawRect = function drawRect(x, y, width, height, color, thickness) {
|
|
25272
|
-
this.engine.graphics.drawRectangle(x, y, width, height, color, thickness);
|
|
25273
|
-
};
|
|
25274
|
-
_proto.drawCircle = function drawCircle(cx, cy, radius, color, thickness) {
|
|
25275
|
-
this.engine.graphics.drawCircle(cx, cy, radius, color, thickness);
|
|
25276
|
-
};
|
|
25277
|
-
_proto.fillTriangle = function fillTriangle(x1, y1, x2, y2, x3, y3, color) {
|
|
25278
|
-
this.engine.graphics.fillTriangle(x1, y1, x2, y2, x3, y3, color);
|
|
25279
|
-
};
|
|
25280
|
-
_proto.fillRect = function fillRect(x, y, width, height, color) {
|
|
25281
|
-
this.engine.graphics.fillRectangle(x, y, width, height, color);
|
|
25282
|
-
};
|
|
25283
|
-
_proto.fillCircle = function fillCircle(cx, cy, radius, color) {
|
|
25284
|
-
this.engine.graphics.fillCircle(cx, cy, radius, color);
|
|
25285
|
-
};
|
|
25286
|
-
_proto.drawTexture = function drawTexture(x, y, width, height, texture, region, color) {
|
|
25287
|
-
this.engine.graphics.drawTexture(x, y, width, height, texture, region, color);
|
|
25288
|
-
};
|
|
25289
|
-
_proto.drawText = function drawText(x, y, text, fontSize, color, fontFamily, fontWeight, fontStyle) {
|
|
25290
|
-
this.engine.graphics.drawText(x, y, text, fontSize, color, fontFamily, fontWeight, fontStyle);
|
|
25291
|
-
};
|
|
25292
|
-
_proto.onMouseEnter = function onMouseEnter(location) {};
|
|
25293
|
-
_proto.onMouseMove = function onMouseMove(event) {};
|
|
25294
|
-
_proto.onMouseLeave = function onMouseLeave() {};
|
|
25295
|
-
_proto.onMouseWheel = function onMouseWheel(event) {};
|
|
25296
|
-
_proto.onMouseDown = function onMouseDown(event) {};
|
|
25297
|
-
_proto.onMouseUp = function onMouseUp(event) {};
|
|
25298
|
-
_proto.onTouchDown = function onTouchDown(event) {};
|
|
25299
|
-
_proto.onTouchMove = function onTouchMove(event) {};
|
|
25300
|
-
_proto.onTouchUp = function onTouchUp(event) {};
|
|
25301
|
-
_proto.onKeyDown = function onKeyDown(event) {};
|
|
25302
|
-
_proto.onKeyUp = function onKeyUp(event) {};
|
|
25303
|
-
_proto.onGotFocus = function onGotFocus() {};
|
|
25304
|
-
_proto.onLostFocus = function onLostFocus() {};
|
|
25305
|
-
/** @internal */ _proto.invokeGetDragData = function invokeGetDragData(position) {
|
|
25306
|
-
return this.getDragData(position);
|
|
25307
|
-
};
|
|
25308
|
-
/** @internal */ _proto.invokeCanDropData = function invokeCanDropData(position, data) {
|
|
25309
|
-
return this.canDropData(position, data);
|
|
25310
|
-
};
|
|
25311
|
-
/** @internal */ _proto.invokeDropData = function invokeDropData(position, data) {
|
|
25312
|
-
this.dropData(position, data);
|
|
25313
|
-
};
|
|
25314
|
-
_proto.getDragData = function getDragData(position) {
|
|
25315
|
-
return null;
|
|
25316
|
-
};
|
|
25317
|
-
_proto.canDropData = function canDropData(position, data) {
|
|
25318
|
-
return false;
|
|
25319
|
-
};
|
|
25320
|
-
_proto.dropData = function dropData(position, data) {};
|
|
25321
|
-
_proto.dispose = function dispose() {
|
|
25322
|
-
if (this.disposed) {
|
|
25323
|
-
return;
|
|
25324
|
-
}
|
|
25325
|
-
this.disposed = true;
|
|
25326
|
-
this.onDestroy();
|
|
25327
|
-
this.parent = null;
|
|
25328
|
-
this.owner = null;
|
|
25329
|
-
};
|
|
25330
|
-
/** @internal */ _proto.updateLayout = function updateLayout() {
|
|
25331
|
-
var _this_parent;
|
|
25332
|
-
var _this_parent_size;
|
|
25333
|
-
var parentSize = (_this_parent_size = (_this_parent = this.parent) == null ? void 0 : _this_parent.size) != null ? _this_parent_size : new Vector2();
|
|
25334
|
-
var left = this.offsetMin.x + this.anchorMin.x * parentSize.x;
|
|
25335
|
-
var top = this.offsetMin.y + this.anchorMin.y * parentSize.y;
|
|
25336
|
-
var right = this.offsetMax.x + this.anchorMax.x * parentSize.x;
|
|
25337
|
-
var bottom = this.offsetMax.y + this.anchorMax.y * parentSize.y;
|
|
25338
|
-
this.applyBounds(left, top, right - left, bottom - top);
|
|
25339
|
-
};
|
|
25340
|
-
_proto.applyBounds = function applyBounds(x, y, width, height) {
|
|
25341
|
-
var locationChanged = this.position.x !== x || this.position.y !== y;
|
|
25342
|
-
var sizeChanged = this.size.x !== width || this.size.y !== height;
|
|
25343
|
-
if (!locationChanged && !sizeChanged) {
|
|
25344
|
-
return;
|
|
25345
|
-
}
|
|
25346
|
-
this.position.set(x, y);
|
|
25347
|
-
this.size.set(width, height);
|
|
25348
|
-
this.markTransformDirty();
|
|
25349
|
-
if (locationChanged) {
|
|
25350
|
-
this.eventEmitter.emit("locationChanged", this);
|
|
25351
|
-
}
|
|
25352
|
-
if (sizeChanged) {
|
|
25353
|
-
this.eventEmitter.emit("sizeChanged", this);
|
|
25354
|
-
if (_instanceof1(this, ContainerControl)) {
|
|
25355
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.children.slice()), _step; !(_step = _iterator()).done;){
|
|
25356
|
-
var child = _step.value;
|
|
25357
|
-
child.updateLayout();
|
|
25358
|
-
}
|
|
25359
|
-
}
|
|
25360
|
-
}
|
|
25361
|
-
};
|
|
25362
|
-
_proto.markTransformDirty = function markTransformDirty() {
|
|
25363
|
-
var _this_root;
|
|
25364
|
-
this.transformDirty = true;
|
|
25365
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlTreeChanged();
|
|
25366
|
-
};
|
|
25367
|
-
_proto.getParentRect = function getParentRect() {
|
|
25368
|
-
var _this_parent;
|
|
25369
|
-
var _this_parent_size_clone;
|
|
25370
|
-
return {
|
|
25371
|
-
position: new Vector2(),
|
|
25372
|
-
size: (_this_parent_size_clone = (_this_parent = this.parent) == null ? void 0 : _this_parent.size.clone()) != null ? _this_parent_size_clone : new Vector2()
|
|
25373
|
-
};
|
|
25374
|
-
};
|
|
25375
|
-
_proto.computeOffsets = function computeOffsets(rect, parentRect) {
|
|
25376
|
-
this.offsetMin.set(rect.position.x - parentRect.position.x - this.anchorMin.x * parentRect.size.x, rect.position.y - parentRect.position.y - this.anchorMin.y * parentRect.size.y);
|
|
25377
|
-
this.offsetMax.set(rect.position.x + rect.size.x - parentRect.position.x - this.anchorMax.x * parentRect.size.x, rect.position.y + rect.size.y - parentRect.position.y - this.anchorMax.y * parentRect.size.y);
|
|
25378
|
-
};
|
|
25379
|
-
_proto.computeAnchors = function computeAnchors(rect, parentRect) {
|
|
25380
|
-
if (parentRect.size.x !== 0) {
|
|
25381
|
-
this.anchorMin.x = (rect.position.x - parentRect.position.x - this.offsetMin.x) / parentRect.size.x;
|
|
25382
|
-
this.anchorMax.x = (rect.position.x + rect.size.x - parentRect.position.x - this.offsetMax.x) / parentRect.size.x;
|
|
25383
|
-
}
|
|
25384
|
-
if (parentRect.size.y !== 0) {
|
|
25385
|
-
this.anchorMin.y = (rect.position.y - parentRect.position.y - this.offsetMin.y) / parentRect.size.y;
|
|
25386
|
-
this.anchorMax.y = (rect.position.y + rect.size.y - parentRect.position.y - this.offsetMax.y) / parentRect.size.y;
|
|
25387
|
-
}
|
|
25388
|
-
};
|
|
25389
|
-
_proto.isMouseRecursiveEnabled = function isMouseRecursiveEnabled() {
|
|
25390
|
-
if (this.mouseBehaviorRecursive === MouseBehaviorRecursive.Inherited) {
|
|
25391
|
-
var _this_parent;
|
|
25392
|
-
var _this_parent_isMouseRecursiveEnabled;
|
|
25393
|
-
return (_this_parent_isMouseRecursiveEnabled = (_this_parent = this.parent) == null ? void 0 : _this_parent.isMouseRecursiveEnabled()) != null ? _this_parent_isMouseRecursiveEnabled : true;
|
|
25394
|
-
}
|
|
25395
|
-
return this.mouseBehaviorRecursive === MouseBehaviorRecursive.Enabled;
|
|
25396
|
-
};
|
|
25397
|
-
_proto.isFocusRecursiveEnabled = function isFocusRecursiveEnabled() {
|
|
25398
|
-
if (this.focusBehaviorRecursive === FocusBehaviorRecursive.Inherited) {
|
|
25399
|
-
var _this_parent;
|
|
25400
|
-
var _this_parent_isFocusRecursiveEnabled;
|
|
25401
|
-
return (_this_parent_isFocusRecursiveEnabled = (_this_parent = this.parent) == null ? void 0 : _this_parent.isFocusRecursiveEnabled()) != null ? _this_parent_isFocusRecursiveEnabled : true;
|
|
25402
|
-
}
|
|
25403
|
-
return this.focusBehaviorRecursive === FocusBehaviorRecursive.Enabled;
|
|
25404
|
-
};
|
|
25405
|
-
_create_class(Control, [
|
|
25406
|
-
{
|
|
25407
|
-
key: "parent",
|
|
25408
|
-
get: function get() {
|
|
25409
|
-
return this._parent;
|
|
25410
|
-
},
|
|
25411
|
-
set: function set(value) {
|
|
25412
|
-
var _this__parent;
|
|
25413
|
-
if (value === this._parent) {
|
|
25414
|
-
return;
|
|
25415
|
-
}
|
|
25416
|
-
var previousRoot = this.root;
|
|
25417
|
-
(_this__parent = this._parent) == null ? void 0 : _this__parent.removeChildInternal(this);
|
|
25418
|
-
this._parent = value;
|
|
25419
|
-
value == null ? void 0 : value.addChildInternal(this);
|
|
25420
|
-
this.updateLayout();
|
|
25421
|
-
var nextRoot = this.root;
|
|
25422
|
-
if (previousRoot && previousRoot !== nextRoot) {
|
|
25423
|
-
previousRoot.controlRemoved(this);
|
|
25424
|
-
}
|
|
25425
|
-
nextRoot == null ? void 0 : nextRoot.controlTreeChanged();
|
|
25426
|
-
this.eventEmitter.emit("parentChanged", this);
|
|
25427
|
-
}
|
|
25428
|
-
},
|
|
25429
|
-
{
|
|
25430
|
-
key: "item",
|
|
25431
|
-
get: /** Scene item exposed through the optional UIControl bridge. */ function get() {
|
|
25432
|
-
var _this_owner;
|
|
25433
|
-
var _this_owner_item;
|
|
25434
|
-
return (_this_owner_item = (_this_owner = this.owner) == null ? void 0 : _this_owner.item) != null ? _this_owner_item : null;
|
|
25435
|
-
}
|
|
25436
|
-
},
|
|
25437
|
-
{
|
|
25438
|
-
key: "indexInParent",
|
|
25439
|
-
get: function get() {
|
|
25440
|
-
var _this_parent;
|
|
25441
|
-
var _this_parent_getChildIndex;
|
|
25442
|
-
return (_this_parent_getChildIndex = (_this_parent = this.parent) == null ? void 0 : _this_parent.getChildIndex(this)) != null ? _this_parent_getChildIndex : -1;
|
|
25443
|
-
},
|
|
25444
|
-
set: function set(value) {
|
|
25445
|
-
var _this_parent;
|
|
25446
|
-
(_this_parent = this.parent) == null ? void 0 : _this_parent.changeChildIndex(this, value);
|
|
25447
|
-
}
|
|
25448
|
-
},
|
|
25449
|
-
{
|
|
25450
|
-
key: "visible",
|
|
25451
|
-
get: function get() {
|
|
25452
|
-
return this._visible;
|
|
25453
|
-
},
|
|
25454
|
-
set: function set(value) {
|
|
25455
|
-
if (this._visible !== value) {
|
|
25456
|
-
var _this_root;
|
|
25457
|
-
this._visible = value;
|
|
25458
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25459
|
-
}
|
|
25460
|
-
}
|
|
25461
|
-
},
|
|
25462
|
-
{
|
|
25463
|
-
key: "visibleInHierarchy",
|
|
25464
|
-
get: function get() {
|
|
25465
|
-
var _this_parent;
|
|
25466
|
-
var _this_parent_visibleInHierarchy;
|
|
25467
|
-
return this.visible && ((_this_parent_visibleInHierarchy = (_this_parent = this.parent) == null ? void 0 : _this_parent.visibleInHierarchy) != null ? _this_parent_visibleInHierarchy : true);
|
|
25468
|
-
}
|
|
25469
|
-
},
|
|
25470
|
-
{
|
|
25471
|
-
key: "enabled",
|
|
25472
|
-
get: function get() {
|
|
25473
|
-
return this._enabled;
|
|
25474
|
-
},
|
|
25475
|
-
set: function set(value) {
|
|
25476
|
-
if (this._enabled !== value) {
|
|
25477
|
-
var _this_root;
|
|
25478
|
-
this._enabled = value;
|
|
25479
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25480
|
-
}
|
|
25481
|
-
}
|
|
25482
|
-
},
|
|
25483
|
-
{
|
|
25484
|
-
key: "enabledInHierarchy",
|
|
25485
|
-
get: function get() {
|
|
25486
|
-
var _this_parent;
|
|
25487
|
-
var _this_parent_enabledInHierarchy;
|
|
25488
|
-
return this.enabled && ((_this_parent_enabledInHierarchy = (_this_parent = this.parent) == null ? void 0 : _this_parent.enabledInHierarchy) != null ? _this_parent_enabledInHierarchy : true);
|
|
25489
|
-
}
|
|
25490
|
-
},
|
|
25491
|
-
{
|
|
25492
|
-
key: "mouseFilter",
|
|
25493
|
-
get: function get() {
|
|
25494
|
-
return this._mouseFilter;
|
|
25495
|
-
},
|
|
25496
|
-
set: function set(value) {
|
|
25497
|
-
if (this._mouseFilter !== value) {
|
|
25498
|
-
var _this_root;
|
|
25499
|
-
this._mouseFilter = value;
|
|
25500
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25501
|
-
}
|
|
25502
|
-
}
|
|
25503
|
-
},
|
|
25504
|
-
{
|
|
25505
|
-
key: "mouseBehaviorRecursive",
|
|
25506
|
-
get: function get() {
|
|
25507
|
-
return this._mouseBehaviorRecursive;
|
|
25508
|
-
},
|
|
25509
|
-
set: function set(value) {
|
|
25510
|
-
if (this._mouseBehaviorRecursive !== value) {
|
|
25511
|
-
var _this_root;
|
|
25512
|
-
this._mouseBehaviorRecursive = value;
|
|
25513
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25514
|
-
}
|
|
25515
|
-
}
|
|
25516
|
-
},
|
|
25517
|
-
{
|
|
25518
|
-
key: "focusMode",
|
|
25519
|
-
get: function get() {
|
|
25520
|
-
return this._focusMode;
|
|
25521
|
-
},
|
|
25522
|
-
set: function set(value) {
|
|
25523
|
-
if (this._focusMode !== value) {
|
|
25524
|
-
var _this_root;
|
|
25525
|
-
this._focusMode = value;
|
|
25526
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25527
|
-
}
|
|
25528
|
-
}
|
|
25529
|
-
},
|
|
25530
|
-
{
|
|
25531
|
-
key: "focusBehaviorRecursive",
|
|
25532
|
-
get: function get() {
|
|
25533
|
-
return this._focusBehaviorRecursive;
|
|
25534
|
-
},
|
|
25535
|
-
set: function set(value) {
|
|
25536
|
-
if (this._focusBehaviorRecursive !== value) {
|
|
25537
|
-
var _this_root;
|
|
25538
|
-
this._focusBehaviorRecursive = value;
|
|
25539
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlStateChanged(this);
|
|
25540
|
-
}
|
|
25541
|
-
}
|
|
25542
|
-
},
|
|
25543
|
-
{
|
|
25544
|
-
key: "defaultCursorShape",
|
|
25545
|
-
get: function get() {
|
|
25546
|
-
return this._defaultCursorShape;
|
|
25547
|
-
},
|
|
25548
|
-
set: function set(value) {
|
|
25549
|
-
var _this_root;
|
|
25550
|
-
if (this._defaultCursorShape === value) {
|
|
25551
|
-
return;
|
|
25552
|
-
}
|
|
25553
|
-
this._defaultCursorShape = value;
|
|
25554
|
-
(_this_root = this.root) == null ? void 0 : _this_root.updateMouseCursorState();
|
|
25555
|
-
}
|
|
25556
|
-
},
|
|
25557
|
-
{
|
|
25558
|
-
key: "location",
|
|
25559
|
-
get: function get() {
|
|
25560
|
-
return this.position;
|
|
25561
|
-
},
|
|
25562
|
-
set: function set(value) {
|
|
25563
|
-
this.setPosition(value.x, value.y);
|
|
25564
|
-
}
|
|
25565
|
-
},
|
|
25566
|
-
{
|
|
25567
|
-
key: "rotation",
|
|
25568
|
-
get: function get() {
|
|
25569
|
-
return this._rotation;
|
|
25570
|
-
}
|
|
25571
|
-
},
|
|
25572
|
-
{
|
|
25573
|
-
key: "x",
|
|
25574
|
-
get: function get() {
|
|
25575
|
-
return this.position.x;
|
|
25576
|
-
},
|
|
25577
|
-
set: function set(value) {
|
|
25578
|
-
this.setPosition(value, this.position.y);
|
|
25579
|
-
}
|
|
25580
|
-
},
|
|
25581
|
-
{
|
|
25582
|
-
key: "y",
|
|
25583
|
-
get: function get() {
|
|
25584
|
-
return this.position.y;
|
|
25585
|
-
},
|
|
25586
|
-
set: function set(value) {
|
|
25587
|
-
this.setPosition(this.position.x, value);
|
|
25588
|
-
}
|
|
25589
|
-
},
|
|
25590
|
-
{
|
|
25591
|
-
key: "width",
|
|
25592
|
-
get: function get() {
|
|
25593
|
-
return this.size.x;
|
|
25594
|
-
},
|
|
25595
|
-
set: function set(value) {
|
|
25596
|
-
this.setSize(value, this.size.y);
|
|
25597
|
-
}
|
|
25598
|
-
},
|
|
25599
|
-
{
|
|
25600
|
-
key: "height",
|
|
25601
|
-
get: function get() {
|
|
25602
|
-
return this.size.y;
|
|
25603
|
-
},
|
|
25604
|
-
set: function set(value) {
|
|
25605
|
-
this.setSize(this.size.x, value);
|
|
25606
|
-
}
|
|
25607
|
-
},
|
|
25608
|
-
{
|
|
25609
|
-
key: "root",
|
|
25610
|
-
get: function get() {
|
|
25611
|
-
var _this_parent;
|
|
25612
|
-
var _this_parent_root;
|
|
25613
|
-
return _instanceof1(this, RootControl) ? this : (_this_parent_root = (_this_parent = this.parent) == null ? void 0 : _this_parent.root) != null ? _this_parent_root : null;
|
|
25614
|
-
}
|
|
25615
|
-
},
|
|
25616
|
-
{
|
|
25617
|
-
key: "isDisposed",
|
|
25618
|
-
get: function get() {
|
|
25619
|
-
return this.disposed;
|
|
25620
|
-
}
|
|
25621
|
-
}
|
|
25622
|
-
]);
|
|
25623
|
-
return Control;
|
|
25624
|
-
}();
|
|
25625
|
-
/** A Control that owns child Controls. */ var ContainerControl = /*#__PURE__*/ function(Control) {
|
|
25626
|
-
_inherits(ContainerControl, Control);
|
|
25627
|
-
function ContainerControl() {
|
|
25628
|
-
var _this;
|
|
25629
|
-
_this = Control.apply(this, arguments) || this;
|
|
25630
|
-
_this.children = [];
|
|
25631
|
-
return _this;
|
|
25632
|
-
}
|
|
25633
|
-
var _proto = ContainerControl.prototype;
|
|
25634
|
-
_proto.addChild = function addChild(child) {
|
|
25635
|
-
child.parent = this;
|
|
25636
|
-
return child;
|
|
25637
|
-
};
|
|
25638
|
-
_proto.removeChild = function removeChild(child) {
|
|
25639
|
-
if (child.parent === this) {
|
|
25640
|
-
child.parent = null;
|
|
25641
|
-
}
|
|
25642
|
-
};
|
|
25643
|
-
_proto.getChildIndex = function getChildIndex(child) {
|
|
25644
|
-
return this.children.indexOf(child);
|
|
25645
|
-
};
|
|
25646
|
-
/** @internal */ _proto.changeChildIndex = function changeChildIndex(child, newIndex) {
|
|
25647
|
-
var _this_root;
|
|
25648
|
-
var oldIndex = this.children.indexOf(child);
|
|
25649
|
-
if (oldIndex === newIndex || oldIndex === -1) {
|
|
25650
|
-
return;
|
|
25651
|
-
}
|
|
25652
|
-
this.children.splice(oldIndex, 1);
|
|
25653
|
-
if (newIndex < 0 || newIndex >= this.children.length) {
|
|
25654
|
-
this.children.push(child);
|
|
25655
|
-
} else {
|
|
25656
|
-
this.children.splice(newIndex, 0, child);
|
|
25657
|
-
}
|
|
25658
|
-
(_this_root = this.root) == null ? void 0 : _this_root.controlTreeChanged();
|
|
25659
|
-
};
|
|
25660
|
-
/** @internal */ _proto.addChildInternal = function addChildInternal(child) {
|
|
25661
|
-
if (!this.children.includes(child)) {
|
|
25662
|
-
this.children.push(child);
|
|
25663
|
-
}
|
|
25664
|
-
};
|
|
25665
|
-
/** @internal */ _proto.removeChildInternal = function removeChildInternal(child) {
|
|
25666
|
-
var index = this.children.indexOf(child);
|
|
25667
|
-
if (index !== -1) {
|
|
25668
|
-
this.children.splice(index, 1);
|
|
25669
|
-
}
|
|
25670
|
-
};
|
|
25671
|
-
_proto.drawSelf = function drawSelf() {
|
|
25672
|
-
Control.prototype.draw.call(this);
|
|
25673
|
-
};
|
|
25674
|
-
_proto.draw = function draw() {
|
|
25675
|
-
this.drawSelf();
|
|
25676
|
-
this.drawChildren();
|
|
25677
|
-
};
|
|
25678
|
-
_proto.drawChildren = function drawChildren() {
|
|
25679
|
-
var graphics = this.engine.graphics;
|
|
25680
|
-
if (this.clipContents) ;
|
|
25681
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
25682
|
-
var child = _step.value;
|
|
25683
|
-
if (!child.visible || child.isDisposed) {
|
|
25684
|
-
continue;
|
|
25685
|
-
}
|
|
25686
|
-
graphics.pushTransform(child.getTransform2D());
|
|
25687
|
-
child.draw();
|
|
25688
|
-
graphics.popTransform();
|
|
25689
|
-
}
|
|
25690
|
-
};
|
|
25691
|
-
_proto.update = function update(deltaTime) {
|
|
25692
|
-
Control.prototype.update.call(this, deltaTime);
|
|
25693
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.children.slice()), _step; !(_step = _iterator()).done;){
|
|
25694
|
-
var child = _step.value;
|
|
25695
|
-
if (child.enabled && !child.isDisposed) {
|
|
25696
|
-
child.update(deltaTime);
|
|
25697
|
-
}
|
|
25698
|
-
}
|
|
25699
|
-
};
|
|
25700
|
-
_proto.dispose = function dispose() {
|
|
25701
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.children.slice()), _step; !(_step = _iterator()).done;){
|
|
25702
|
-
var child = _step.value;
|
|
25703
|
-
child.dispose();
|
|
25704
|
-
}
|
|
25705
|
-
Control.prototype.dispose.call(this);
|
|
25706
|
-
};
|
|
25707
|
-
return ContainerControl;
|
|
25708
|
-
}(Control);
|
|
25709
|
-
/** Base class for GUI tree roots and input dispatchers. */ var RootControl = /*#__PURE__*/ function(ContainerControl) {
|
|
25710
|
-
_inherits(RootControl, ContainerControl);
|
|
25711
|
-
function RootControl() {
|
|
25712
|
-
return ContainerControl.apply(this, arguments);
|
|
25713
|
-
}
|
|
25714
|
-
return RootControl;
|
|
25715
|
-
}(ContainerControl);
|
|
25716
|
-
|
|
25717
|
-
var _obj$4;
|
|
25718
|
-
var cursorNames = (_obj$4 = {}, _obj$4[CursorShape.Arrow] = "default", _obj$4[CursorShape.Ibeam] = "text", _obj$4[CursorShape.PointingHand] = "pointer", _obj$4[CursorShape.Cross] = "crosshair", _obj$4[CursorShape.Wait] = "wait", _obj$4[CursorShape.Busy] = "progress", _obj$4[CursorShape.Drag] = "grab", _obj$4[CursorShape.CanDrop] = "copy", _obj$4[CursorShape.Forbidden] = "not-allowed", _obj$4[CursorShape.Vsize] = "ns-resize", _obj$4[CursorShape.Hsize] = "ew-resize", _obj$4[CursorShape.Bdiagsize] = "nesw-resize", _obj$4[CursorShape.Fdiagsize] = "nwse-resize", _obj$4[CursorShape.Move] = "move", _obj$4[CursorShape.Vsplit] = "row-resize", _obj$4[CursorShape.Hsplit] = "col-resize", _obj$4[CursorShape.Help] = "help", _obj$4);
|
|
25719
|
-
function getButtonMask(button) {
|
|
25720
|
-
switch(button){
|
|
25721
|
-
case MouseButton.Left:
|
|
25722
|
-
return MouseButtonMask.Left;
|
|
25723
|
-
case MouseButton.Right:
|
|
25724
|
-
return MouseButtonMask.Right;
|
|
25725
|
-
case MouseButton.Middle:
|
|
25726
|
-
return MouseButtonMask.Middle;
|
|
25727
|
-
case MouseButton.Xbutton1:
|
|
25728
|
-
return MouseButtonMask.Xbutton1;
|
|
25729
|
-
case MouseButton.Xbutton2:
|
|
25730
|
-
return MouseButtonMask.Xbutton2;
|
|
25731
|
-
default:
|
|
25732
|
-
return MouseButtonMask.None;
|
|
25733
|
-
}
|
|
25734
|
-
}
|
|
25735
|
-
function isWheelButton(button) {
|
|
25736
|
-
return button >= MouseButton.WheelUp && button <= MouseButton.WheelRight;
|
|
25737
|
-
}
|
|
25738
|
-
/** CanvasLayer-like boundary for a single UICanvas GUI tree. */ var CanvasRootControl = /*#__PURE__*/ function(ContainerControl) {
|
|
25739
|
-
_inherits(CanvasRootControl, ContainerControl);
|
|
25740
|
-
function CanvasRootControl(engine, canvas) {
|
|
25741
|
-
var _this;
|
|
25742
|
-
_this = ContainerControl.call(this, engine) || this;
|
|
25743
|
-
_this.canvas = canvas;
|
|
25744
|
-
_this.mouseFilter = MouseFilter.Ignore;
|
|
25745
|
-
_this.setSize(engine.canvas.width, engine.canvas.height);
|
|
25746
|
-
return _this;
|
|
25747
|
-
}
|
|
25748
|
-
_create_class(CanvasRootControl, [
|
|
25749
|
-
{
|
|
25750
|
-
key: "inputDisabled",
|
|
25751
|
-
get: function get() {
|
|
25752
|
-
var _this_canvas_item;
|
|
25753
|
-
return !this.canvas.receivesEvents || !this.canvas.enabled || !((_this_canvas_item = this.canvas.item) == null ? void 0 : _this_canvas_item.isActive);
|
|
25754
|
-
}
|
|
25755
|
-
}
|
|
25756
|
-
]);
|
|
25757
|
-
return CanvasRootControl;
|
|
25758
|
-
}(ContainerControl);
|
|
25759
|
-
/** Global ordered collection of UICanvas roots. */ var CanvasContainer = /*#__PURE__*/ function(ContainerControl) {
|
|
25760
|
-
_inherits(CanvasContainer, ContainerControl);
|
|
25761
|
-
function CanvasContainer(engine) {
|
|
25762
|
-
var _this;
|
|
25763
|
-
_this = ContainerControl.call(this, engine) || this;
|
|
25764
|
-
_this.mouseFilter = MouseFilter.Ignore;
|
|
25765
|
-
_this.setSize(engine.canvas.width, engine.canvas.height);
|
|
25766
|
-
return _this;
|
|
25767
|
-
}
|
|
25768
|
-
var _proto = CanvasContainer.prototype;
|
|
25769
|
-
_proto.sortCanvases = function sortCanvases() {
|
|
25770
|
-
this.children.sort(function(left, right) {
|
|
25771
|
-
return left.canvas.order - right.canvas.order;
|
|
25772
|
-
});
|
|
25773
|
-
};
|
|
25774
|
-
_proto.addChildInternal = function addChildInternal(child) {
|
|
25775
|
-
ContainerControl.prototype.addChildInternal.call(this, child);
|
|
25776
|
-
this.sortCanvases();
|
|
25777
|
-
};
|
|
25778
|
-
_proto.draw = function draw() {
|
|
25779
|
-
this.sortCanvases();
|
|
25780
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
25781
|
-
var child = _step.value;
|
|
25782
|
-
var root = child;
|
|
25783
|
-
if (root.canvas.isVisible) {
|
|
25784
|
-
root.draw();
|
|
25785
|
-
}
|
|
25786
|
-
}
|
|
25787
|
-
};
|
|
25788
|
-
return CanvasContainer;
|
|
25789
|
-
}(ContainerControl);
|
|
25790
|
-
/** Engine window GUI root. Routes events across all UICanvas roots. */ var WindowRootControl = /*#__PURE__*/ function(RootControl) {
|
|
25791
|
-
_inherits(WindowRootControl, RootControl);
|
|
25792
|
-
function WindowRootControl(engine) {
|
|
25793
|
-
var _this;
|
|
25794
|
-
_this = RootControl.call(this, engine) || this;
|
|
25795
|
-
_this.dragThreshold = 10;
|
|
25796
|
-
_this.lastInput = null;
|
|
25797
|
-
_this.gui = {
|
|
25798
|
-
mouseFocus: null,
|
|
25799
|
-
mouseClickGrabber: null,
|
|
25800
|
-
mouseFocusMask: MouseButtonMask.None,
|
|
25801
|
-
mouseOver: null,
|
|
25802
|
-
mouseOverHierarchy: [],
|
|
25803
|
-
touchFocus: new Map(),
|
|
25804
|
-
keyFocus: null,
|
|
25805
|
-
dragAccum: new Vector2(),
|
|
25806
|
-
dragAttempted: false,
|
|
25807
|
-
dragging: false,
|
|
25808
|
-
dragData: null,
|
|
25809
|
-
dragMouseOver: null,
|
|
25810
|
-
dragSuccessful: false,
|
|
25811
|
-
lastMousePosition: new Vector2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY),
|
|
25812
|
-
sendingMouseEnterExit: false,
|
|
25813
|
-
mouseOverUpdatePending: false
|
|
25814
|
-
};
|
|
25815
|
-
_this.mouseFilter = MouseFilter.Ignore;
|
|
25816
|
-
_this.setSize(engine.canvas.width, engine.canvas.height);
|
|
25817
|
-
_this.canvases = new CanvasContainer(engine);
|
|
25818
|
-
_this.canvases.parent = _assert_this_initialized(_this);
|
|
25819
|
-
return _this;
|
|
25820
|
-
}
|
|
25821
|
-
var _proto = WindowRootControl.prototype;
|
|
25822
|
-
_proto.pushInput = function pushInput(event) {
|
|
25823
|
-
event.clearAccepted();
|
|
25824
|
-
this.lastInput = event;
|
|
25825
|
-
this.cleanupInternalState();
|
|
25826
|
-
this.processGUIInput(event);
|
|
25827
|
-
this.postGrabClickFocus();
|
|
25828
|
-
};
|
|
25829
|
-
_proto.isInputHandled = function isInputHandled() {
|
|
25830
|
-
var _this_lastInput;
|
|
25831
|
-
var _this_lastInput_isAccepted;
|
|
25832
|
-
return (_this_lastInput_isAccepted = (_this_lastInput = this.lastInput) == null ? void 0 : _this_lastInput.isAccepted()) != null ? _this_lastInput_isAccepted : false;
|
|
25833
|
-
};
|
|
25834
|
-
_proto.getMousePosition = function getMousePosition() {
|
|
25835
|
-
return this.gui.lastMousePosition.clone();
|
|
25836
|
-
};
|
|
25837
|
-
_proto.guiGetFocusOwner = function guiGetFocusOwner() {
|
|
25838
|
-
return this.isFocusTargetUsable(this.gui.keyFocus) ? this.gui.keyFocus : null;
|
|
25839
|
-
};
|
|
25840
|
-
_proto.guiReleaseFocus = function guiReleaseFocus() {
|
|
25841
|
-
this.releaseControlFocus();
|
|
25842
|
-
};
|
|
25843
|
-
_proto.guiIsDragging = function guiIsDragging() {
|
|
25844
|
-
return this.gui.dragging;
|
|
25845
|
-
};
|
|
25846
|
-
_proto.guiGetDragData = function guiGetDragData() {
|
|
25847
|
-
return this.gui.dragData;
|
|
25848
|
-
};
|
|
25849
|
-
_proto.guiIsDragSuccessful = function guiIsDragSuccessful() {
|
|
25850
|
-
return this.gui.dragSuccessful;
|
|
25851
|
-
};
|
|
25852
|
-
_proto.guiCancelDrag = function guiCancelDrag() {
|
|
25853
|
-
this.endDragging(false);
|
|
25854
|
-
};
|
|
25855
|
-
_proto.grabControlFocus = function grabControlFocus(control) {
|
|
25856
|
-
if (!this.isFocusTargetUsable(control) || this.gui.keyFocus === control) {
|
|
25857
|
-
return;
|
|
25858
|
-
}
|
|
25859
|
-
var previous = this.gui.keyFocus;
|
|
25860
|
-
this.gui.keyFocus = control;
|
|
25861
|
-
if (previous && !previous.isDisposed) {
|
|
25862
|
-
previous.onLostFocus();
|
|
25863
|
-
}
|
|
25864
|
-
control.onGotFocus();
|
|
25865
|
-
};
|
|
25866
|
-
_proto.grabControlClickFocus = function grabControlClickFocus(control) {
|
|
25867
|
-
var _this = this;
|
|
25868
|
-
if (this.isControlValid(control)) {
|
|
25869
|
-
this.gui.mouseClickGrabber = control;
|
|
25870
|
-
queueMicrotask(function() {
|
|
25871
|
-
return _this.postGrabClickFocus();
|
|
25872
|
-
});
|
|
25873
|
-
}
|
|
25874
|
-
};
|
|
25875
|
-
_proto.releaseControlFocus = function releaseControlFocus(control) {
|
|
25876
|
-
var previous = this.gui.keyFocus;
|
|
25877
|
-
if (!previous || control && previous !== control) {
|
|
25878
|
-
return;
|
|
25879
|
-
}
|
|
25880
|
-
this.gui.keyFocus = null;
|
|
25881
|
-
if (!previous.isDisposed) {
|
|
25882
|
-
previous.onLostFocus();
|
|
25883
|
-
}
|
|
25884
|
-
};
|
|
25885
|
-
_proto.warpControlMouse = function warpControlMouse(position) {
|
|
25886
|
-
this.gui.lastMousePosition.copyFrom(position);
|
|
25887
|
-
this.updateMouseOver(position);
|
|
25888
|
-
this.updateMouseCursorState();
|
|
25889
|
-
};
|
|
25890
|
-
_proto.updateMouseCursorState = function updateMouseCursorState() {
|
|
25891
|
-
var position = this.gui.lastMousePosition;
|
|
25892
|
-
var target = this.isControlUsable(this.gui.mouseFocus) ? this.gui.mouseFocus : this.isControlUsable(this.gui.mouseOver) ? this.gui.mouseOver : null;
|
|
25893
|
-
this.updateCursor(target, position);
|
|
25894
|
-
};
|
|
25895
|
-
_proto.controlStateChanged = function controlStateChanged(control) {
|
|
25896
|
-
if (!this.isControlUsable(control)) {
|
|
25897
|
-
this.dropControlState(control);
|
|
25898
|
-
}
|
|
25899
|
-
this.requestMouseOverUpdate();
|
|
25900
|
-
};
|
|
25901
|
-
_proto.controlRemoved = function controlRemoved(control) {
|
|
25902
|
-
this.dropControlState(control);
|
|
25903
|
-
this.cleanupInternalState();
|
|
25904
|
-
this.requestMouseOverUpdate();
|
|
25905
|
-
};
|
|
25906
|
-
_proto.controlTreeChanged = function controlTreeChanged() {
|
|
25907
|
-
this.requestMouseOverUpdate();
|
|
25908
|
-
};
|
|
25909
|
-
_proto.cancelPointerInput = function cancelPointerInput() {
|
|
25910
|
-
this.dropMouseFocus();
|
|
25911
|
-
this.dropMouseOver();
|
|
25912
|
-
this.gui.touchFocus.clear();
|
|
25913
|
-
this.endDragging(false);
|
|
25914
|
-
this.releaseControlFocus();
|
|
25915
|
-
};
|
|
25916
|
-
_proto.resize = function resize(width, height) {
|
|
25917
|
-
this.setSize(width, height);
|
|
25918
|
-
this.canvases.setSize(width, height);
|
|
25919
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.canvases.children), _step; !(_step = _iterator()).done;){
|
|
25920
|
-
var root = _step.value;
|
|
25921
|
-
root.setSize(width, height);
|
|
25922
|
-
}
|
|
25923
|
-
};
|
|
25924
|
-
_proto.render = function render() {
|
|
25925
|
-
if (this.canvases.children.length === 0) {
|
|
25926
|
-
return;
|
|
25927
|
-
}
|
|
25928
|
-
this.engine.graphics.begin();
|
|
25929
|
-
this.draw();
|
|
25930
|
-
this.engine.graphics.end();
|
|
25931
|
-
};
|
|
25932
|
-
_proto.update = function update(deltaTime) {
|
|
25933
|
-
if (this.gui.mouseOverUpdatePending) {
|
|
25934
|
-
this.gui.mouseOverUpdatePending = false;
|
|
25935
|
-
this.updateMouseOver(this.gui.lastMousePosition);
|
|
25936
|
-
}
|
|
25937
|
-
RootControl.prototype.update.call(this, deltaTime);
|
|
25938
|
-
};
|
|
25939
|
-
_proto.dispose = function dispose() {
|
|
25940
|
-
this.cancelPointerInput();
|
|
25941
|
-
RootControl.prototype.dispose.call(this);
|
|
25942
|
-
};
|
|
25943
|
-
_proto.processGUIInput = function processGUIInput(event) {
|
|
25944
|
-
if (_instanceof1(event, InputEventKey)) {
|
|
25945
|
-
var target = this.guiGetFocusOwner();
|
|
25946
|
-
if (target) {
|
|
25947
|
-
this.callControlInput(target, event);
|
|
25948
|
-
}
|
|
25949
|
-
} else if (_instanceof1(event, InputEventMouse)) {
|
|
25950
|
-
this.gui.lastMousePosition.copyFrom(event.globalPosition);
|
|
25951
|
-
this.updateMouseOver(event.globalPosition);
|
|
25952
|
-
if (_instanceof1(event, InputEventMouseButton)) {
|
|
25953
|
-
this.processMouseButton(event);
|
|
25954
|
-
} else if (_instanceof1(event, InputEventMouseMotion)) {
|
|
25955
|
-
this.processMouseMotion(event);
|
|
25956
|
-
}
|
|
25957
|
-
} else if (_instanceof1(event, InputEventScreenTouch)) {
|
|
25958
|
-
this.processScreenTouch(event);
|
|
25959
|
-
} else if (_instanceof1(event, InputEventScreenDrag)) {
|
|
25960
|
-
this.processScreenDrag(event);
|
|
25961
|
-
}
|
|
25962
|
-
};
|
|
25963
|
-
_proto.processMouseButton = function processMouseButton(event) {
|
|
25964
|
-
if (isWheelButton(event.buttonIndex)) {
|
|
25965
|
-
var target = this.findInputControl(event.globalPosition);
|
|
25966
|
-
if (target) {
|
|
25967
|
-
this.callGUIInput(target, event);
|
|
25968
|
-
}
|
|
25969
|
-
return;
|
|
25970
|
-
}
|
|
25971
|
-
var mask = getButtonMask(event.buttonIndex);
|
|
25972
|
-
if (event.isPressed()) {
|
|
25973
|
-
var target1 = this.gui.mouseFocusMask !== 0 ? this.gui.mouseFocus : this.findInputControl(event.globalPosition);
|
|
25974
|
-
this.gui.mouseFocus = target1;
|
|
25975
|
-
if (!target1) {
|
|
25976
|
-
return;
|
|
25977
|
-
}
|
|
25978
|
-
this.gui.mouseFocusMask |= mask;
|
|
25979
|
-
if (event.buttonIndex === MouseButton.Left) {
|
|
25980
|
-
this.gui.dragAccum.setZero();
|
|
25981
|
-
this.gui.dragAttempted = false;
|
|
25982
|
-
this.findClickFocus(target1);
|
|
25983
|
-
}
|
|
25984
|
-
this.callGUIInput(target1, event);
|
|
25985
|
-
} else {
|
|
25986
|
-
if (event.buttonIndex === MouseButton.Left && this.gui.dragging) {
|
|
25987
|
-
this.finishDrop(event.globalPosition);
|
|
25988
|
-
}
|
|
25989
|
-
this.gui.mouseFocusMask &= ~mask;
|
|
25990
|
-
var target2 = this.gui.mouseFocus;
|
|
25991
|
-
if (this.gui.mouseFocusMask === 0) {
|
|
25992
|
-
this.gui.mouseFocus = null;
|
|
25993
|
-
}
|
|
25994
|
-
if (this.isControlUsable(target2)) {
|
|
25995
|
-
this.callGUIInput(target2, event);
|
|
25996
|
-
}
|
|
25997
|
-
}
|
|
25998
|
-
};
|
|
25999
|
-
_proto.processMouseMotion = function processMouseMotion(event) {
|
|
26000
|
-
if (!this.gui.dragging && !this.gui.dragAttempted && this.gui.mouseFocus && (this.gui.mouseFocusMask & MouseButtonMask.Left) !== 0) {
|
|
26001
|
-
this.gui.dragAccum.add(event.relative);
|
|
26002
|
-
if (this.gui.dragAccum.length() > this.dragThreshold) {
|
|
26003
|
-
var origin = event.globalPosition.clone().subtract(this.gui.dragAccum);
|
|
26004
|
-
this.beginDragging(this.gui.mouseFocus, origin);
|
|
26005
|
-
this.gui.dragAttempted = true;
|
|
26006
|
-
}
|
|
26007
|
-
}
|
|
26008
|
-
var target = this.isControlUsable(this.gui.mouseFocus) ? this.gui.mouseFocus : this.findInputControl(event.globalPosition);
|
|
26009
|
-
if (target) {
|
|
26010
|
-
this.callGUIInput(target, event);
|
|
26011
|
-
}
|
|
26012
|
-
if (this.gui.dragging) {
|
|
26013
|
-
this.gui.dragMouseOver = this.findDropTarget(this.findInputControl(event.globalPosition), event.globalPosition);
|
|
26014
|
-
}
|
|
26015
|
-
this.updateCursor(target, event.globalPosition);
|
|
26016
|
-
};
|
|
26017
|
-
_proto.processScreenTouch = function processScreenTouch(event) {
|
|
26018
|
-
var target;
|
|
26019
|
-
if (event.isPressed()) {
|
|
26020
|
-
target = this.findInputControl(event.position);
|
|
26021
|
-
if (target) {
|
|
26022
|
-
this.gui.touchFocus.set(event.index, target);
|
|
26023
|
-
}
|
|
26024
|
-
} else {
|
|
26025
|
-
var _this_gui_touchFocus_get;
|
|
26026
|
-
target = (_this_gui_touchFocus_get = this.gui.touchFocus.get(event.index)) != null ? _this_gui_touchFocus_get : null;
|
|
26027
|
-
this.gui.touchFocus.delete(event.index);
|
|
26028
|
-
}
|
|
26029
|
-
if (this.isControlUsable(target)) {
|
|
26030
|
-
this.callGUIInput(target, event);
|
|
26031
|
-
}
|
|
26032
|
-
};
|
|
26033
|
-
_proto.processScreenDrag = function processScreenDrag(event) {
|
|
26034
|
-
var _this_gui_touchFocus_get;
|
|
26035
|
-
var target = (_this_gui_touchFocus_get = this.gui.touchFocus.get(event.index)) != null ? _this_gui_touchFocus_get : this.findInputControl(event.position);
|
|
26036
|
-
if (this.isControlUsable(target)) {
|
|
26037
|
-
this.callGUIInput(target, event);
|
|
26038
|
-
}
|
|
26039
|
-
};
|
|
26040
|
-
_proto.callGUIInput = function callGUIInput(target, event) {
|
|
26041
|
-
var current = target;
|
|
26042
|
-
var pointerEvent = _instanceof1(event, InputEventMouse) || _instanceof1(event, InputEventScreenTouch) || _instanceof1(event, InputEventScreenDrag);
|
|
26043
|
-
while(current && current !== this && this.isControlUsable(current)){
|
|
26044
|
-
var filter = current.getEffectiveMouseFilter();
|
|
26045
|
-
if (filter !== MouseFilter.Ignore) {
|
|
26046
|
-
var localEvent = event.xformedBy(this.getGlobalInverse(current));
|
|
26047
|
-
this.callControlInput(current, localEvent);
|
|
26048
|
-
if (localEvent.isAccepted()) {
|
|
26049
|
-
event.accept();
|
|
26050
|
-
}
|
|
26051
|
-
}
|
|
26052
|
-
var forcePassWheel = _instanceof1(event, InputEventMouseButton) && isWheelButton(event.buttonIndex) && current.mouseForcePassScrollEvents;
|
|
26053
|
-
if (event.isAccepted() || filter === MouseFilter.Stop && pointerEvent && !forcePassWheel) {
|
|
26054
|
-
event.accept();
|
|
26055
|
-
return;
|
|
26056
|
-
}
|
|
26057
|
-
current = current.parent;
|
|
26058
|
-
}
|
|
26059
|
-
};
|
|
26060
|
-
_proto.callControlInput = function callControlInput(control, event) {
|
|
26061
|
-
if (_instanceof1(event, InputEventMouseButton)) {
|
|
26062
|
-
if (isWheelButton(event.buttonIndex)) {
|
|
26063
|
-
control.onMouseWheel(event);
|
|
26064
|
-
} else if (event.isPressed()) {
|
|
26065
|
-
control.onMouseDown(event);
|
|
26066
|
-
} else {
|
|
26067
|
-
control.onMouseUp(event);
|
|
26068
|
-
}
|
|
26069
|
-
} else if (_instanceof1(event, InputEventMouseMotion)) {
|
|
26070
|
-
control.onMouseMove(event);
|
|
26071
|
-
} else if (_instanceof1(event, InputEventScreenTouch)) {
|
|
26072
|
-
if (event.isPressed()) {
|
|
26073
|
-
control.onTouchDown(event);
|
|
26074
|
-
} else {
|
|
26075
|
-
control.onTouchUp(event);
|
|
26076
|
-
}
|
|
26077
|
-
} else if (_instanceof1(event, InputEventScreenDrag)) {
|
|
26078
|
-
control.onTouchMove(event);
|
|
26079
|
-
} else if (_instanceof1(event, InputEventKey)) {
|
|
26080
|
-
if (event.isPressed()) {
|
|
26081
|
-
control.onKeyDown(event);
|
|
26082
|
-
} else if (event.isReleased()) {
|
|
26083
|
-
control.onKeyUp(event);
|
|
26084
|
-
}
|
|
26085
|
-
}
|
|
26086
|
-
};
|
|
26087
|
-
_proto.findInputControl = function findInputControl(position) {
|
|
26088
|
-
this.canvases.sortCanvases();
|
|
26089
|
-
for(var index = this.canvases.children.length - 1; index >= 0; index--){
|
|
26090
|
-
var root = this.canvases.children[index];
|
|
26091
|
-
if (!root.canvas.isVisible || root.inputDisabled) {
|
|
26092
|
-
continue;
|
|
26093
|
-
}
|
|
26094
|
-
var target = this.findControlAtPosition(root, position, true);
|
|
26095
|
-
if (target) {
|
|
26096
|
-
return target;
|
|
26097
|
-
}
|
|
26098
|
-
}
|
|
26099
|
-
return null;
|
|
26100
|
-
};
|
|
26101
|
-
_proto.findControlAtPosition = function findControlAtPosition(container, position, skipSelf) {
|
|
26102
|
-
if (skipSelf === void 0) skipSelf = false;
|
|
26103
|
-
if (!container.visibleInHierarchy || container.isDisposed) {
|
|
26104
|
-
return null;
|
|
26105
|
-
}
|
|
26106
|
-
var localPosition = this.toLocal(container, position);
|
|
26107
|
-
if (container.clipContents && !container.hasPoint(localPosition)) {
|
|
26108
|
-
return null;
|
|
26109
|
-
}
|
|
26110
|
-
for(var index = container.children.length - 1; index >= 0; index--){
|
|
26111
|
-
var child = container.children[index];
|
|
26112
|
-
if (!child.visibleInHierarchy || child.isDisposed) {
|
|
26113
|
-
continue;
|
|
26114
|
-
}
|
|
26115
|
-
if (_instanceof1(child, ContainerControl)) {
|
|
26116
|
-
var found = this.findControlAtPosition(child, position);
|
|
26117
|
-
if (found) {
|
|
26118
|
-
return found;
|
|
26119
|
-
}
|
|
26120
|
-
} else if (child.getEffectiveMouseFilter() !== MouseFilter.Ignore && child.hasPoint(this.toLocal(child, position))) {
|
|
26121
|
-
return child;
|
|
26122
|
-
}
|
|
26123
|
-
}
|
|
26124
|
-
if (!skipSelf && container.getEffectiveMouseFilter() !== MouseFilter.Ignore && container.hasPoint(localPosition)) {
|
|
26125
|
-
return container;
|
|
26126
|
-
}
|
|
26127
|
-
return null;
|
|
26128
|
-
};
|
|
26129
|
-
_proto.updateMouseOver = function updateMouseOver(position) {
|
|
26130
|
-
if (this.gui.sendingMouseEnterExit) {
|
|
26131
|
-
this.gui.mouseOverUpdatePending = true;
|
|
26132
|
-
return;
|
|
26133
|
-
}
|
|
26134
|
-
this.gui.mouseOverUpdatePending = false;
|
|
26135
|
-
var target = this.findInputControl(position);
|
|
26136
|
-
var next = this.buildHoverHierarchy(target);
|
|
26137
|
-
var previous = this.gui.mouseOverHierarchy;
|
|
26138
|
-
var common = 0;
|
|
26139
|
-
while(common < previous.length && common < next.length && previous[common] === next[common]){
|
|
26140
|
-
common++;
|
|
26141
|
-
}
|
|
26142
|
-
this.gui.sendingMouseEnterExit = true;
|
|
26143
|
-
for(var index = previous.length - 1; index >= common; index--){
|
|
26144
|
-
if (!previous[index].isDisposed) {
|
|
26145
|
-
previous[index].onMouseLeave();
|
|
26146
|
-
}
|
|
26147
|
-
}
|
|
26148
|
-
for(var index1 = common; index1 < next.length; index1++){
|
|
26149
|
-
next[index1].onMouseEnter(this.toLocal(next[index1], position));
|
|
26150
|
-
}
|
|
26151
|
-
this.gui.sendingMouseEnterExit = false;
|
|
26152
|
-
this.gui.mouseOver = target;
|
|
26153
|
-
this.gui.mouseOverHierarchy = next;
|
|
26154
|
-
};
|
|
26155
|
-
_proto.buildHoverHierarchy = function buildHoverHierarchy(target) {
|
|
26156
|
-
var hierarchy = [];
|
|
26157
|
-
var current = target;
|
|
26158
|
-
while(current && current !== this){
|
|
26159
|
-
if (current.getEffectiveMouseFilter() !== MouseFilter.Ignore) {
|
|
26160
|
-
hierarchy.push(current);
|
|
26161
|
-
}
|
|
26162
|
-
if (current.getEffectiveMouseFilter() === MouseFilter.Stop) {
|
|
26163
|
-
break;
|
|
26164
|
-
}
|
|
26165
|
-
current = current.parent;
|
|
26166
|
-
}
|
|
26167
|
-
hierarchy.reverse();
|
|
26168
|
-
return hierarchy;
|
|
26169
|
-
};
|
|
26170
|
-
_proto.findClickFocus = function findClickFocus(target) {
|
|
26171
|
-
var current = target;
|
|
26172
|
-
while(current && current !== this){
|
|
26173
|
-
var mode = current.getFocusModeWithOverride();
|
|
26174
|
-
if (mode === FocusMode.Click || mode === FocusMode.All) {
|
|
26175
|
-
this.grabControlFocus(current);
|
|
26176
|
-
return;
|
|
26177
|
-
}
|
|
26178
|
-
if (current.getEffectiveMouseFilter() === MouseFilter.Stop) {
|
|
26179
|
-
return;
|
|
26180
|
-
}
|
|
26181
|
-
current = current.parent;
|
|
26182
|
-
}
|
|
26183
|
-
};
|
|
26184
|
-
_proto.beginDragging = function beginDragging(source, position) {
|
|
26185
|
-
var current = source;
|
|
26186
|
-
while(current && current !== this){
|
|
26187
|
-
var data = current.invokeGetDragData(this.toLocal(current, position));
|
|
26188
|
-
if (data !== null && data !== undefined) {
|
|
26189
|
-
this.gui.dragging = true;
|
|
26190
|
-
this.gui.dragData = data;
|
|
26191
|
-
this.gui.mouseFocus = null;
|
|
26192
|
-
this.gui.mouseFocusMask = MouseButtonMask.None;
|
|
26193
|
-
return;
|
|
26194
|
-
}
|
|
26195
|
-
if (current.getEffectiveMouseFilter() === MouseFilter.Stop) {
|
|
26196
|
-
return;
|
|
26197
|
-
}
|
|
26198
|
-
current = current.parent;
|
|
26199
|
-
}
|
|
26200
|
-
};
|
|
26201
|
-
_proto.finishDrop = function finishDrop(position) {
|
|
26202
|
-
var target = this.findDropTarget(this.findInputControl(position), position);
|
|
26203
|
-
if (target) {
|
|
26204
|
-
target.invokeDropData(this.toLocal(target, position), this.gui.dragData);
|
|
26205
|
-
}
|
|
26206
|
-
this.endDragging(!!target);
|
|
26207
|
-
};
|
|
26208
|
-
_proto.findDropTarget = function findDropTarget(target, position) {
|
|
26209
|
-
var current = target;
|
|
26210
|
-
while(current && current !== this){
|
|
26211
|
-
if (current.invokeCanDropData(this.toLocal(current, position), this.gui.dragData)) {
|
|
26212
|
-
return current;
|
|
26213
|
-
}
|
|
26214
|
-
if (current.getEffectiveMouseFilter() === MouseFilter.Stop) {
|
|
26215
|
-
return null;
|
|
26216
|
-
}
|
|
26217
|
-
current = current.parent;
|
|
26218
|
-
}
|
|
26219
|
-
return null;
|
|
26220
|
-
};
|
|
26221
|
-
_proto.endDragging = function endDragging(successful) {
|
|
26222
|
-
this.gui.dragSuccessful = successful;
|
|
26223
|
-
this.gui.dragging = false;
|
|
26224
|
-
this.gui.dragData = null;
|
|
26225
|
-
this.gui.dragMouseOver = null;
|
|
26226
|
-
};
|
|
26227
|
-
_proto.updateCursor = function updateCursor(target, position) {
|
|
26228
|
-
var current = target;
|
|
26229
|
-
var cursor = CursorShape.Arrow;
|
|
26230
|
-
while(current && current !== this){
|
|
26231
|
-
var candidate = current.getCursorShape(this.toLocal(current, position));
|
|
26232
|
-
if (candidate !== CursorShape.Arrow) {
|
|
26233
|
-
cursor = candidate;
|
|
26234
|
-
break;
|
|
26235
|
-
}
|
|
26236
|
-
if (current.getEffectiveMouseFilter() === MouseFilter.Stop) {
|
|
26237
|
-
break;
|
|
26238
|
-
}
|
|
26239
|
-
current = current.parent;
|
|
26240
|
-
}
|
|
26241
|
-
this.engine.canvas.style.cursor = typeof cursor === "string" ? cursor : cursorNames[cursor];
|
|
26242
|
-
};
|
|
26243
|
-
_proto.postGrabClickFocus = function postGrabClickFocus() {
|
|
26244
|
-
var target = this.gui.mouseClickGrabber;
|
|
26245
|
-
this.gui.mouseClickGrabber = null;
|
|
26246
|
-
if (this.isControlUsable(target)) {
|
|
26247
|
-
this.gui.mouseFocus = target;
|
|
26248
|
-
}
|
|
26249
|
-
};
|
|
26250
|
-
_proto.cleanupInternalState = function cleanupInternalState() {
|
|
26251
|
-
if (!this.isControlUsable(this.gui.mouseFocus)) {
|
|
26252
|
-
this.dropMouseFocus();
|
|
26253
|
-
}
|
|
26254
|
-
if (this.gui.keyFocus && !this.isFocusTargetUsable(this.gui.keyFocus)) {
|
|
26255
|
-
this.releaseControlFocus(this.gui.keyFocus);
|
|
26256
|
-
}
|
|
26257
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.gui.touchFocus), _step; !(_step = _iterator()).done;){
|
|
26258
|
-
var _step_value = _step.value, index = _step_value[0], control = _step_value[1];
|
|
26259
|
-
if (!this.isControlUsable(control)) {
|
|
26260
|
-
this.gui.touchFocus.delete(index);
|
|
26261
|
-
}
|
|
26262
|
-
}
|
|
26263
|
-
};
|
|
26264
|
-
_proto.dropMouseFocus = function dropMouseFocus() {
|
|
26265
|
-
this.gui.mouseFocus = null;
|
|
26266
|
-
this.gui.mouseFocusMask = MouseButtonMask.None;
|
|
26267
|
-
};
|
|
26268
|
-
_proto.dropMouseOver = function dropMouseOver() {
|
|
26269
|
-
for(var index = this.gui.mouseOverHierarchy.length - 1; index >= 0; index--){
|
|
26270
|
-
var control = this.gui.mouseOverHierarchy[index];
|
|
26271
|
-
if (!control.isDisposed) {
|
|
26272
|
-
control.onMouseLeave();
|
|
26273
|
-
}
|
|
26274
|
-
}
|
|
26275
|
-
this.gui.mouseOver = null;
|
|
26276
|
-
this.gui.mouseOverHierarchy = [];
|
|
26277
|
-
};
|
|
26278
|
-
_proto.dropControlState = function dropControlState(control) {
|
|
26279
|
-
if (this.controlBelongsToSubtree(this.gui.mouseFocus, control)) {
|
|
26280
|
-
this.dropMouseFocus();
|
|
26281
|
-
}
|
|
26282
|
-
if (this.controlBelongsToSubtree(this.gui.mouseClickGrabber, control)) {
|
|
26283
|
-
this.gui.mouseClickGrabber = null;
|
|
26284
|
-
}
|
|
26285
|
-
if (this.controlBelongsToSubtree(this.gui.keyFocus, control)) {
|
|
26286
|
-
var _this_gui_keyFocus;
|
|
26287
|
-
this.releaseControlFocus((_this_gui_keyFocus = this.gui.keyFocus) != null ? _this_gui_keyFocus : undefined);
|
|
26288
|
-
}
|
|
26289
|
-
if (this.controlBelongsToSubtree(this.gui.mouseOver, control)) {
|
|
26290
|
-
this.dropMouseOver();
|
|
26291
|
-
}
|
|
26292
|
-
if (this.controlBelongsToSubtree(this.gui.dragMouseOver, control)) {
|
|
26293
|
-
this.gui.dragMouseOver = null;
|
|
26294
|
-
}
|
|
26295
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(this.gui.touchFocus), _step; !(_step = _iterator()).done;){
|
|
26296
|
-
var _step_value = _step.value, index = _step_value[0], target = _step_value[1];
|
|
26297
|
-
if (this.controlBelongsToSubtree(target, control)) {
|
|
26298
|
-
this.gui.touchFocus.delete(index);
|
|
26299
|
-
}
|
|
26300
|
-
}
|
|
26301
|
-
};
|
|
26302
|
-
_proto.requestMouseOverUpdate = function requestMouseOverUpdate() {
|
|
26303
|
-
if (Number.isFinite(this.gui.lastMousePosition.x)) {
|
|
26304
|
-
this.updateMouseOver(this.gui.lastMousePosition);
|
|
26305
|
-
}
|
|
26306
|
-
};
|
|
26307
|
-
_proto.getGlobalInverse = function getGlobalInverse(control) {
|
|
26308
|
-
var transform = control.getGlobalTransform2D().clone();
|
|
26309
|
-
return Math.abs(transform.determinant()) < 1e-12 ? new Matrix3() : transform.invert();
|
|
26310
|
-
};
|
|
26311
|
-
_proto.toLocal = function toLocal(control, position) {
|
|
26312
|
-
var elements = this.getGlobalInverse(control).elements;
|
|
26313
|
-
return new Vector2(elements[0] * position.x + elements[3] * position.y + elements[6], elements[1] * position.x + elements[4] * position.y + elements[7]);
|
|
26314
|
-
};
|
|
26315
|
-
_proto.controlBelongsToSubtree = function controlBelongsToSubtree(control, subtree) {
|
|
26316
|
-
var current = control;
|
|
26317
|
-
while(current){
|
|
26318
|
-
if (current === subtree) {
|
|
26319
|
-
return true;
|
|
26320
|
-
}
|
|
26321
|
-
current = current.parent;
|
|
26322
|
-
}
|
|
26323
|
-
return false;
|
|
26324
|
-
};
|
|
26325
|
-
_proto.isControlValid = function isControlValid(control) {
|
|
26326
|
-
return !!control && !control.isDisposed && control.root === this;
|
|
26327
|
-
};
|
|
26328
|
-
_proto.isControlUsable = function isControlUsable(control) {
|
|
26329
|
-
if (!this.isControlValid(control) || !control.visibleInHierarchy || !control.enabledInHierarchy) {
|
|
26330
|
-
return false;
|
|
26331
|
-
}
|
|
26332
|
-
var root = this.findCanvasRoot(control);
|
|
26333
|
-
return !root || !root.inputDisabled;
|
|
26334
|
-
};
|
|
26335
|
-
_proto.findCanvasRoot = function findCanvasRoot(control) {
|
|
26336
|
-
var current = control;
|
|
26337
|
-
while(current && current !== this){
|
|
26338
|
-
if (_instanceof1(current, CanvasRootControl)) {
|
|
26339
|
-
return current;
|
|
26340
|
-
}
|
|
26341
|
-
current = current.parent;
|
|
26342
|
-
}
|
|
26343
|
-
return null;
|
|
26344
|
-
};
|
|
26345
|
-
_proto.isFocusTargetUsable = function isFocusTargetUsable(control) {
|
|
26346
|
-
return this.isControlUsable(control) && control.getFocusModeWithOverride() !== FocusMode.None;
|
|
26347
|
-
};
|
|
26348
|
-
return WindowRootControl;
|
|
26349
|
-
}(RootControl);
|
|
26350
|
-
|
|
26351
|
-
var CanvasRenderMode;
|
|
26352
|
-
(function(CanvasRenderMode) {
|
|
26353
|
-
CanvasRenderMode[CanvasRenderMode["ScreenSpace"] = 0] = "ScreenSpace";
|
|
26354
|
-
CanvasRenderMode[CanvasRenderMode["CameraSpace"] = 1] = "CameraSpace";
|
|
26355
|
-
CanvasRenderMode[CanvasRenderMode["WorldSpace"] = 2] = "WorldSpace";
|
|
26356
|
-
CanvasRenderMode[CanvasRenderMode["WorldSpaceFaceCamera"] = 3] = "WorldSpaceFaceCamera";
|
|
26357
|
-
})(CanvasRenderMode || (CanvasRenderMode = {}));
|
|
26358
|
-
/** Canvas-layer boundary attached to a VFXItem. Input state remains owned by the window root. */ var UICanvas = /*#__PURE__*/ function(Component) {
|
|
26359
|
-
_inherits(UICanvas, Component);
|
|
26360
|
-
function UICanvas(engine) {
|
|
26361
|
-
var _this;
|
|
26362
|
-
_this = Component.call(this, engine) || this;
|
|
26363
|
-
_this.renderMode = 0;
|
|
26364
|
-
_this.receivesEvents = true;
|
|
26365
|
-
_this._order = 0;
|
|
26366
|
-
_this.registered = false;
|
|
26367
|
-
_this.rootControl = new CanvasRootControl(engine, _assert_this_initialized(_this));
|
|
26368
|
-
return _this;
|
|
26369
|
-
}
|
|
26370
|
-
var _proto = UICanvas.prototype;
|
|
26371
|
-
_proto.onEnable = function onEnable() {
|
|
26372
|
-
this.register();
|
|
26373
|
-
};
|
|
26374
|
-
_proto.onDisable = function onDisable() {
|
|
26375
|
-
this.unregister();
|
|
26376
|
-
};
|
|
26377
|
-
_proto.onDestroy = function onDestroy() {
|
|
26378
|
-
this.destroyCanvas();
|
|
26379
|
-
};
|
|
26380
|
-
_proto.dispose = function dispose() {
|
|
26381
|
-
this.destroyCanvas();
|
|
26382
|
-
Component.prototype.dispose.call(this);
|
|
26383
|
-
};
|
|
26384
|
-
_proto.register = function register() {
|
|
26385
|
-
if (!this.registered) {
|
|
26386
|
-
this.rootControl.parent = this.engine.windowRoot.canvases;
|
|
26387
|
-
this.registered = true;
|
|
26388
|
-
}
|
|
26389
|
-
};
|
|
26390
|
-
_proto.unregister = function unregister() {
|
|
26391
|
-
if (this.registered) {
|
|
26392
|
-
this.rootControl.parent = null;
|
|
26393
|
-
this.registered = false;
|
|
26394
|
-
}
|
|
26395
|
-
};
|
|
26396
|
-
_proto.destroyCanvas = function destroyCanvas() {
|
|
26397
|
-
this.unregister();
|
|
26398
|
-
if (!this.rootControl.isDisposed) {
|
|
26399
|
-
this.rootControl.dispose();
|
|
26400
|
-
}
|
|
26401
|
-
};
|
|
26402
|
-
_create_class(UICanvas, [
|
|
26403
|
-
{
|
|
26404
|
-
key: "order",
|
|
26405
|
-
get: function get() {
|
|
26406
|
-
return this._order;
|
|
26407
|
-
},
|
|
26408
|
-
set: function set(value) {
|
|
26409
|
-
if (this._order !== value) {
|
|
26410
|
-
this._order = value;
|
|
26411
|
-
this.engine.windowRoot.canvases.sortCanvases();
|
|
26412
|
-
}
|
|
26413
|
-
}
|
|
26414
|
-
},
|
|
26415
|
-
{
|
|
26416
|
-
key: "isVisible",
|
|
26417
|
-
get: function get() {
|
|
26418
|
-
var _this_item;
|
|
26419
|
-
return this.renderMode === 0 && this.enabled && !!((_this_item = this.item) == null ? void 0 : _this_item.isActive);
|
|
26420
|
-
}
|
|
26421
|
-
}
|
|
26422
|
-
]);
|
|
26423
|
-
return UICanvas;
|
|
26424
|
-
}(Component);
|
|
26425
|
-
|
|
26426
|
-
/**
|
|
26427
|
-
* Scene-tree bridge for a GUI Control. The VFXItem tree owns lifecycle and
|
|
26428
|
-
* serialization while the Control tree owns layout, drawing and input.
|
|
26429
|
-
*/ var UIControl = /*#__PURE__*/ function(Component) {
|
|
26430
|
-
_inherits(UIControl, Component);
|
|
26431
|
-
function UIControl(engine) {
|
|
26432
|
-
var _this;
|
|
26433
|
-
_this = Component.call(this, engine) || this;
|
|
26434
|
-
_this.controlNode = null;
|
|
26435
|
-
_this.linkedItemTransform = null;
|
|
26436
|
-
_this.linkedControl = null;
|
|
26437
|
-
_this.syncingLocation = false;
|
|
26438
|
-
_this.itemTransformChanged = function() {
|
|
26439
|
-
return _this.syncItemLocationToControl();
|
|
26440
|
-
};
|
|
26441
|
-
_this.controlLocationChanged = function() {
|
|
26442
|
-
return _this.syncControlLocationToItem();
|
|
26443
|
-
};
|
|
26444
|
-
return _this;
|
|
26445
|
-
}
|
|
26446
|
-
var _proto = UIControl.prototype;
|
|
26447
|
-
_proto.onAwake = function onAwake() {
|
|
26448
|
-
this.syncControl();
|
|
26449
|
-
};
|
|
26450
|
-
_proto.onEnable = function onEnable() {
|
|
26451
|
-
if (this.controlNode) {
|
|
26452
|
-
this.controlNode.visible = this.item.isActive;
|
|
26453
|
-
this.controlNode.enabled = true;
|
|
26454
|
-
}
|
|
26455
|
-
};
|
|
26456
|
-
_proto.onDisable = function onDisable() {
|
|
26457
|
-
if (this.controlNode) {
|
|
26458
|
-
this.controlNode.visible = this.item.isActive;
|
|
26459
|
-
this.controlNode.enabled = false;
|
|
26460
|
-
}
|
|
26461
|
-
};
|
|
26462
|
-
_proto.onParentChanged = function onParentChanged() {
|
|
26463
|
-
this.syncControl();
|
|
26464
|
-
};
|
|
26465
|
-
_proto.onOrderInParentChanged = function onOrderInParentChanged() {
|
|
26466
|
-
this.syncControlOrder();
|
|
26467
|
-
};
|
|
26468
|
-
_proto.onDestroy = function onDestroy() {
|
|
26469
|
-
this.disposeControl();
|
|
26470
|
-
};
|
|
26471
|
-
_proto.dispose = function dispose() {
|
|
26472
|
-
this.disposeControl();
|
|
26473
|
-
Component.prototype.dispose.call(this);
|
|
26474
|
-
};
|
|
26475
|
-
/** Unlinks the GUI object without disposing or modifying it. */ _proto.unlinkControl = function unlinkControl() {
|
|
26476
|
-
if (this.controlNode) {
|
|
26477
|
-
this.unbindLocationSync();
|
|
26478
|
-
this.controlNode = null;
|
|
26479
|
-
}
|
|
26480
|
-
};
|
|
26481
|
-
_proto.disposeControl = function disposeControl() {
|
|
26482
|
-
var control = this.controlNode;
|
|
26483
|
-
if (control) {
|
|
26484
|
-
this.unbindLocationSync();
|
|
26485
|
-
this.controlNode = null;
|
|
26486
|
-
control.dispose();
|
|
26487
|
-
}
|
|
26488
|
-
};
|
|
26489
|
-
_proto.syncControl = function syncControl() {
|
|
26490
|
-
var control = this.controlNode;
|
|
26491
|
-
if (!control || !this.item) {
|
|
26492
|
-
return;
|
|
26493
|
-
}
|
|
26494
|
-
this.syncingLocation = true;
|
|
26495
|
-
try {
|
|
26496
|
-
control.visible = this.item.isActive;
|
|
26497
|
-
control.enabled = this.enabled;
|
|
26498
|
-
control.parent = this.resolveParent();
|
|
26499
|
-
this.syncControlOrder();
|
|
26500
|
-
this.copyItemLocationToControl();
|
|
26501
|
-
} finally{
|
|
26502
|
-
this.syncingLocation = false;
|
|
26503
|
-
}
|
|
26504
|
-
this.bindLocationSync();
|
|
26505
|
-
};
|
|
26506
|
-
_proto.syncControlOrder = function syncControlOrder() {
|
|
26507
|
-
if (this.controlNode && this.item) {
|
|
26508
|
-
this.controlNode.indexInParent = this.item.orderInParent;
|
|
26509
|
-
}
|
|
26510
|
-
};
|
|
26511
|
-
_proto.resolveParent = function resolveParent() {
|
|
26512
|
-
var parentItem = this.item.parent;
|
|
26513
|
-
if (!parentItem) {
|
|
26514
|
-
var _UIControl_fallbackParentGetDelegate;
|
|
26515
|
-
return (_UIControl_fallbackParentGetDelegate = UIControl.fallbackParentGetDelegate == null ? void 0 : UIControl.fallbackParentGetDelegate.call(UIControl, this)) != null ? _UIControl_fallbackParentGetDelegate : null;
|
|
26516
|
-
}
|
|
26517
|
-
var uiControl = parentItem.getComponent(UIControl);
|
|
26518
|
-
if ((uiControl == null ? void 0 : uiControl.control) && "children" in uiControl.control) {
|
|
26519
|
-
return uiControl.control;
|
|
26520
|
-
}
|
|
26521
|
-
var canvas = parentItem.getComponent(UICanvas);
|
|
26522
|
-
var _canvas_rootControl, _ref;
|
|
26523
|
-
return (_ref = (_canvas_rootControl = canvas == null ? void 0 : canvas.rootControl) != null ? _canvas_rootControl : UIControl.fallbackParentGetDelegate == null ? void 0 : UIControl.fallbackParentGetDelegate.call(UIControl, this)) != null ? _ref : null;
|
|
26524
|
-
};
|
|
26525
|
-
_proto.bindLocationSync = function bindLocationSync() {
|
|
26526
|
-
var itemTransform = this.item.transform;
|
|
26527
|
-
var control = this.controlNode;
|
|
26528
|
-
if (this.linkedItemTransform === itemTransform && this.linkedControl === control) {
|
|
26529
|
-
return;
|
|
26530
|
-
}
|
|
26531
|
-
this.unbindLocationSync();
|
|
26532
|
-
if (control) {
|
|
26533
|
-
this.linkedItemTransform = itemTransform;
|
|
26534
|
-
this.linkedControl = control;
|
|
26535
|
-
itemTransform.on("changed", this.itemTransformChanged);
|
|
26536
|
-
control.on("locationChanged", this.controlLocationChanged);
|
|
26537
|
-
}
|
|
26538
|
-
};
|
|
26539
|
-
_proto.unbindLocationSync = function unbindLocationSync() {
|
|
26540
|
-
var _this_linkedItemTransform, _this_linkedControl;
|
|
26541
|
-
(_this_linkedItemTransform = this.linkedItemTransform) == null ? void 0 : _this_linkedItemTransform.off("changed", this.itemTransformChanged);
|
|
26542
|
-
(_this_linkedControl = this.linkedControl) == null ? void 0 : _this_linkedControl.off("locationChanged", this.controlLocationChanged);
|
|
26543
|
-
this.linkedItemTransform = null;
|
|
26544
|
-
this.linkedControl = null;
|
|
26545
|
-
};
|
|
26546
|
-
_proto.syncItemLocationToControl = function syncItemLocationToControl() {
|
|
26547
|
-
if (!this.syncingLocation && this.controlNode) {
|
|
26548
|
-
this.syncingLocation = true;
|
|
26549
|
-
try {
|
|
26550
|
-
this.copyItemLocationToControl();
|
|
26551
|
-
} finally{
|
|
26552
|
-
this.syncingLocation = false;
|
|
26553
|
-
}
|
|
26554
|
-
}
|
|
26555
|
-
};
|
|
26556
|
-
_proto.syncControlLocationToItem = function syncControlLocationToItem() {
|
|
26557
|
-
var control = this.controlNode;
|
|
26558
|
-
if (!this.syncingLocation && control) {
|
|
26559
|
-
var source = control.location;
|
|
26560
|
-
var target = this.item.transform.position;
|
|
26561
|
-
if (source.x !== target.x || source.y !== target.y) {
|
|
26562
|
-
this.syncingLocation = true;
|
|
26563
|
-
try {
|
|
26564
|
-
this.item.transform.setPosition(source.x, source.y, target.z);
|
|
26565
|
-
} finally{
|
|
26566
|
-
this.syncingLocation = false;
|
|
26567
|
-
}
|
|
26568
|
-
}
|
|
26569
|
-
}
|
|
26570
|
-
};
|
|
26571
|
-
_proto.copyItemLocationToControl = function copyItemLocationToControl() {
|
|
26572
|
-
var control = this.controlNode;
|
|
26573
|
-
if (control) {
|
|
26574
|
-
var source = this.item.transform.position;
|
|
26575
|
-
var target = control.location;
|
|
26576
|
-
if (source.x !== target.x || source.y !== target.y) {
|
|
26577
|
-
control.setPosition(source.x, source.y);
|
|
26578
|
-
}
|
|
26579
|
-
}
|
|
26580
|
-
};
|
|
26581
|
-
_create_class(UIControl, [
|
|
26582
|
-
{
|
|
26583
|
-
key: "control",
|
|
26584
|
-
get: function get() {
|
|
26585
|
-
return this.controlNode;
|
|
26586
|
-
},
|
|
26587
|
-
set: function set(value) {
|
|
26588
|
-
if (value === this.controlNode) {
|
|
26589
|
-
return;
|
|
26590
|
-
}
|
|
26591
|
-
this.disposeControl();
|
|
26592
|
-
if (value) {
|
|
26593
|
-
if (value.owner && value.owner !== this && value.owner.control === value) {
|
|
26594
|
-
throw new Error("A Control can only be owned by one UIControl.");
|
|
26595
|
-
}
|
|
26596
|
-
this.controlNode = value;
|
|
26597
|
-
value.owner = this;
|
|
26598
|
-
this.syncControl();
|
|
26599
|
-
}
|
|
26600
|
-
}
|
|
26601
|
-
},
|
|
26602
|
-
{
|
|
26603
|
-
key: "hasControl",
|
|
26604
|
-
get: function get() {
|
|
26605
|
-
return this.controlNode !== null;
|
|
26606
|
-
}
|
|
26607
|
-
}
|
|
26608
|
-
]);
|
|
26609
|
-
return UIControl;
|
|
26610
|
-
}(Component);
|
|
26611
|
-
|
|
26612
24755
|
var CameraController = /*#__PURE__*/ function(Component) {
|
|
26613
24756
|
_inherits(CameraController, Component);
|
|
26614
24757
|
function CameraController(engine, props) {
|
|
@@ -26643,6 +24786,42 @@ CameraController = __decorate([
|
|
|
26643
24786
|
effectsClass(DataType.CameraController)
|
|
26644
24787
|
], CameraController);
|
|
26645
24788
|
|
|
24789
|
+
function _get_prototype_of(o) {
|
|
24790
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
24791
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
24792
|
+
};
|
|
24793
|
+
return _get_prototype_of(o);
|
|
24794
|
+
}
|
|
24795
|
+
|
|
24796
|
+
function _is_native_function(fn) {
|
|
24797
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
24798
|
+
}
|
|
24799
|
+
|
|
24800
|
+
function _wrap_native_super(Class) {
|
|
24801
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
24802
|
+
_wrap_native_super = function _wrap_native_super(Class) {
|
|
24803
|
+
if (Class === null || !_is_native_function(Class)) return Class;
|
|
24804
|
+
if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
24805
|
+
if (typeof _cache !== "undefined") {
|
|
24806
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
24807
|
+
_cache.set(Class, Wrapper);
|
|
24808
|
+
}
|
|
24809
|
+
function Wrapper() {
|
|
24810
|
+
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
24811
|
+
}
|
|
24812
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
24813
|
+
constructor: {
|
|
24814
|
+
value: Wrapper,
|
|
24815
|
+
enumerable: false,
|
|
24816
|
+
writable: true,
|
|
24817
|
+
configurable: true
|
|
24818
|
+
}
|
|
24819
|
+
});
|
|
24820
|
+
return _set_prototype_of(Wrapper, Class);
|
|
24821
|
+
};
|
|
24822
|
+
return _wrap_native_super(Class);
|
|
24823
|
+
}
|
|
24824
|
+
|
|
26646
24825
|
var CameraVFXItemLoader = /*#__PURE__*/ function(Plugin) {
|
|
26647
24826
|
_inherits(CameraVFXItemLoader, Plugin);
|
|
26648
24827
|
function CameraVFXItemLoader() {
|
|
@@ -26651,6 +24830,255 @@ var CameraVFXItemLoader = /*#__PURE__*/ function(Plugin) {
|
|
|
26651
24830
|
return CameraVFXItemLoader;
|
|
26652
24831
|
}(_wrap_native_super(Plugin));
|
|
26653
24832
|
|
|
24833
|
+
var MouseButton;
|
|
24834
|
+
(function(MouseButton) {
|
|
24835
|
+
MouseButton[MouseButton["None"] = 0] = "None";
|
|
24836
|
+
MouseButton[MouseButton["Left"] = 1] = "Left";
|
|
24837
|
+
MouseButton[MouseButton["Right"] = 2] = "Right";
|
|
24838
|
+
MouseButton[MouseButton["Middle"] = 3] = "Middle";
|
|
24839
|
+
MouseButton[MouseButton["WheelUp"] = 4] = "WheelUp";
|
|
24840
|
+
MouseButton[MouseButton["WheelDown"] = 5] = "WheelDown";
|
|
24841
|
+
MouseButton[MouseButton["WheelLeft"] = 6] = "WheelLeft";
|
|
24842
|
+
MouseButton[MouseButton["WheelRight"] = 7] = "WheelRight";
|
|
24843
|
+
MouseButton[MouseButton["Xbutton1"] = 8] = "Xbutton1";
|
|
24844
|
+
MouseButton[MouseButton["Xbutton2"] = 9] = "Xbutton2";
|
|
24845
|
+
})(MouseButton || (MouseButton = {}));
|
|
24846
|
+
var MouseButtonMask;
|
|
24847
|
+
(function(MouseButtonMask) {
|
|
24848
|
+
MouseButtonMask[MouseButtonMask["None"] = 0] = "None";
|
|
24849
|
+
MouseButtonMask[MouseButtonMask["Left"] = 1] = "Left";
|
|
24850
|
+
MouseButtonMask[MouseButtonMask["Right"] = 2] = "Right";
|
|
24851
|
+
MouseButtonMask[MouseButtonMask["Middle"] = 4] = "Middle";
|
|
24852
|
+
MouseButtonMask[MouseButtonMask["Xbutton1"] = 128] = "Xbutton1";
|
|
24853
|
+
MouseButtonMask[MouseButtonMask["Xbutton2"] = 256] = "Xbutton2";
|
|
24854
|
+
})(MouseButtonMask || (MouseButtonMask = {}));
|
|
24855
|
+
var KeyLocation;
|
|
24856
|
+
(function(KeyLocation) {
|
|
24857
|
+
KeyLocation[KeyLocation["Unspecified"] = 0] = "Unspecified";
|
|
24858
|
+
KeyLocation[KeyLocation["Left"] = 1] = "Left";
|
|
24859
|
+
KeyLocation[KeyLocation["Right"] = 2] = "Right";
|
|
24860
|
+
})(KeyLocation || (KeyLocation = {}));
|
|
24861
|
+
|
|
24862
|
+
function transformPoint(transform, value) {
|
|
24863
|
+
var elements = transform.elements;
|
|
24864
|
+
return new Vector2(elements[0] * value.x + elements[3] * value.y + elements[6], elements[1] * value.x + elements[4] * value.y + elements[7]);
|
|
24865
|
+
}
|
|
24866
|
+
function transformVector(transform, value) {
|
|
24867
|
+
var elements = transform.elements;
|
|
24868
|
+
return new Vector2(elements[0] * value.x + elements[3] * value.y, elements[1] * value.x + elements[4] * value.y);
|
|
24869
|
+
}
|
|
24870
|
+
var InputEvent = /*#__PURE__*/ function() {
|
|
24871
|
+
function InputEvent() {
|
|
24872
|
+
this.device = 0;
|
|
24873
|
+
this.pressed = false;
|
|
24874
|
+
this.canceled = false;
|
|
24875
|
+
this._accepted = false;
|
|
24876
|
+
}
|
|
24877
|
+
var _proto = InputEvent.prototype;
|
|
24878
|
+
_proto.accept = function accept() {
|
|
24879
|
+
this._accepted = true;
|
|
24880
|
+
};
|
|
24881
|
+
_proto.clearAccepted = function clearAccepted() {
|
|
24882
|
+
this._accepted = false;
|
|
24883
|
+
};
|
|
24884
|
+
_proto.isAccepted = function isAccepted() {
|
|
24885
|
+
return this._accepted;
|
|
24886
|
+
};
|
|
24887
|
+
_proto.isPressed = function isPressed() {
|
|
24888
|
+
return this.pressed && !this.canceled;
|
|
24889
|
+
};
|
|
24890
|
+
_proto.isReleased = function isReleased() {
|
|
24891
|
+
return !this.pressed && !this.canceled;
|
|
24892
|
+
};
|
|
24893
|
+
_proto.isCanceled = function isCanceled() {
|
|
24894
|
+
return this.canceled;
|
|
24895
|
+
};
|
|
24896
|
+
_proto.isEcho = function isEcho() {
|
|
24897
|
+
return false;
|
|
24898
|
+
};
|
|
24899
|
+
_proto.xformedBy = function xformedBy(transform) {
|
|
24900
|
+
return this;
|
|
24901
|
+
};
|
|
24902
|
+
return InputEvent;
|
|
24903
|
+
}();
|
|
24904
|
+
InputEvent.deviceIdEmulation = -1;
|
|
24905
|
+
InputEvent.deviceIdInternal = -2;
|
|
24906
|
+
InputEvent.deviceIdKeyboard = 16;
|
|
24907
|
+
InputEvent.deviceIdMouse = 32;
|
|
24908
|
+
var InputEventWithModifiers = /*#__PURE__*/ function(InputEvent) {
|
|
24909
|
+
_inherits(InputEventWithModifiers, InputEvent);
|
|
24910
|
+
function InputEventWithModifiers() {
|
|
24911
|
+
var _this;
|
|
24912
|
+
_this = InputEvent.apply(this, arguments) || this;
|
|
24913
|
+
_this.commandOrControlAutoremap = false;
|
|
24914
|
+
_this.shiftPressed = false;
|
|
24915
|
+
_this.altPressed = false;
|
|
24916
|
+
_this.metaPressed = false;
|
|
24917
|
+
_this.ctrlPressed = false;
|
|
24918
|
+
return _this;
|
|
24919
|
+
}
|
|
24920
|
+
var _proto = InputEventWithModifiers.prototype;
|
|
24921
|
+
_proto.copyModifiersTo = function copyModifiersTo(event) {
|
|
24922
|
+
event.device = this.device;
|
|
24923
|
+
event.pressed = this.pressed;
|
|
24924
|
+
event.canceled = this.canceled;
|
|
24925
|
+
event.commandOrControlAutoremap = this.commandOrControlAutoremap;
|
|
24926
|
+
event.shiftPressed = this.shiftPressed;
|
|
24927
|
+
event.altPressed = this.altPressed;
|
|
24928
|
+
event.metaPressed = this.metaPressed;
|
|
24929
|
+
event.ctrlPressed = this.ctrlPressed;
|
|
24930
|
+
};
|
|
24931
|
+
return InputEventWithModifiers;
|
|
24932
|
+
}(_wrap_native_super(InputEvent));
|
|
24933
|
+
var InputEventKey = /*#__PURE__*/ function(InputEventWithModifiers) {
|
|
24934
|
+
_inherits(InputEventKey, InputEventWithModifiers);
|
|
24935
|
+
function InputEventKey() {
|
|
24936
|
+
var _this;
|
|
24937
|
+
_this = InputEventWithModifiers.apply(this, arguments) || this;
|
|
24938
|
+
_this.keycode = "";
|
|
24939
|
+
_this.physicalKeycode = "";
|
|
24940
|
+
_this.keyLabel = "";
|
|
24941
|
+
_this.unicode = 0;
|
|
24942
|
+
_this.location = KeyLocation.Unspecified;
|
|
24943
|
+
_this.echo = false;
|
|
24944
|
+
return _this;
|
|
24945
|
+
}
|
|
24946
|
+
var _proto = InputEventKey.prototype;
|
|
24947
|
+
_proto.isEcho = function isEcho() {
|
|
24948
|
+
return this.echo;
|
|
24949
|
+
};
|
|
24950
|
+
return InputEventKey;
|
|
24951
|
+
}(InputEventWithModifiers);
|
|
24952
|
+
var InputEventMouse = /*#__PURE__*/ function(InputEventWithModifiers) {
|
|
24953
|
+
_inherits(InputEventMouse, InputEventWithModifiers);
|
|
24954
|
+
function InputEventMouse() {
|
|
24955
|
+
var _this;
|
|
24956
|
+
_this = InputEventWithModifiers.apply(this, arguments) || this;
|
|
24957
|
+
_this.buttonMask = MouseButtonMask.None;
|
|
24958
|
+
_this.position = new Vector2();
|
|
24959
|
+
_this.globalPosition = new Vector2();
|
|
24960
|
+
return _this;
|
|
24961
|
+
}
|
|
24962
|
+
var _proto = InputEventMouse.prototype;
|
|
24963
|
+
_proto.copyMouseTo = function copyMouseTo(event) {
|
|
24964
|
+
this.copyModifiersTo(event);
|
|
24965
|
+
event.buttonMask = this.buttonMask;
|
|
24966
|
+
event.position.copyFrom(this.position);
|
|
24967
|
+
event.globalPosition.copyFrom(this.globalPosition);
|
|
24968
|
+
};
|
|
24969
|
+
return InputEventMouse;
|
|
24970
|
+
}(InputEventWithModifiers);
|
|
24971
|
+
var InputEventMouseButton = /*#__PURE__*/ function(InputEventMouse) {
|
|
24972
|
+
_inherits(InputEventMouseButton, InputEventMouse);
|
|
24973
|
+
function InputEventMouseButton() {
|
|
24974
|
+
var _this;
|
|
24975
|
+
_this = InputEventMouse.apply(this, arguments) || this;
|
|
24976
|
+
_this.factor = 1;
|
|
24977
|
+
_this.buttonIndex = MouseButton.None;
|
|
24978
|
+
_this.doubleClick = false;
|
|
24979
|
+
return _this;
|
|
24980
|
+
}
|
|
24981
|
+
var _proto = InputEventMouseButton.prototype;
|
|
24982
|
+
_proto.xformedBy = function xformedBy(transform) {
|
|
24983
|
+
var event = new InputEventMouseButton();
|
|
24984
|
+
this.copyMouseTo(event);
|
|
24985
|
+
event.position.copyFrom(transformPoint(transform, this.position));
|
|
24986
|
+
event.factor = this.factor;
|
|
24987
|
+
event.buttonIndex = this.buttonIndex;
|
|
24988
|
+
event.doubleClick = this.doubleClick;
|
|
24989
|
+
return event;
|
|
24990
|
+
};
|
|
24991
|
+
return InputEventMouseButton;
|
|
24992
|
+
}(InputEventMouse);
|
|
24993
|
+
var InputEventMouseMotion = /*#__PURE__*/ function(InputEventMouse) {
|
|
24994
|
+
_inherits(InputEventMouseMotion, InputEventMouse);
|
|
24995
|
+
function InputEventMouseMotion() {
|
|
24996
|
+
var _this;
|
|
24997
|
+
_this = InputEventMouse.apply(this, arguments) || this;
|
|
24998
|
+
_this.tilt = new Vector2();
|
|
24999
|
+
_this.pressure = 0;
|
|
25000
|
+
_this.relative = new Vector2();
|
|
25001
|
+
_this.screenRelative = new Vector2();
|
|
25002
|
+
_this.velocity = new Vector2();
|
|
25003
|
+
_this.screenVelocity = new Vector2();
|
|
25004
|
+
_this.penInverted = false;
|
|
25005
|
+
return _this;
|
|
25006
|
+
}
|
|
25007
|
+
var _proto = InputEventMouseMotion.prototype;
|
|
25008
|
+
_proto.xformedBy = function xformedBy(transform) {
|
|
25009
|
+
var event = new InputEventMouseMotion();
|
|
25010
|
+
this.copyMouseTo(event);
|
|
25011
|
+
event.position.copyFrom(transformPoint(transform, this.position));
|
|
25012
|
+
event.tilt.copyFrom(this.tilt);
|
|
25013
|
+
event.pressure = this.pressure;
|
|
25014
|
+
event.relative.copyFrom(transformVector(transform, this.relative));
|
|
25015
|
+
event.screenRelative.copyFrom(this.screenRelative);
|
|
25016
|
+
event.velocity.copyFrom(transformVector(transform, this.velocity));
|
|
25017
|
+
event.screenVelocity.copyFrom(this.screenVelocity);
|
|
25018
|
+
event.penInverted = this.penInverted;
|
|
25019
|
+
return event;
|
|
25020
|
+
};
|
|
25021
|
+
return InputEventMouseMotion;
|
|
25022
|
+
}(InputEventMouse);
|
|
25023
|
+
var InputEventScreenTouch = /*#__PURE__*/ function(InputEvent) {
|
|
25024
|
+
_inherits(InputEventScreenTouch, InputEvent);
|
|
25025
|
+
function InputEventScreenTouch() {
|
|
25026
|
+
var _this;
|
|
25027
|
+
_this = InputEvent.apply(this, arguments) || this;
|
|
25028
|
+
_this.index = 0;
|
|
25029
|
+
_this.position = new Vector2();
|
|
25030
|
+
_this.doubleTap = false;
|
|
25031
|
+
return _this;
|
|
25032
|
+
}
|
|
25033
|
+
var _proto = InputEventScreenTouch.prototype;
|
|
25034
|
+
_proto.xformedBy = function xformedBy(transform) {
|
|
25035
|
+
var event = new InputEventScreenTouch();
|
|
25036
|
+
event.device = this.device;
|
|
25037
|
+
event.pressed = this.pressed;
|
|
25038
|
+
event.canceled = this.canceled;
|
|
25039
|
+
event.index = this.index;
|
|
25040
|
+
event.position.copyFrom(transformPoint(transform, this.position));
|
|
25041
|
+
event.doubleTap = this.doubleTap;
|
|
25042
|
+
return event;
|
|
25043
|
+
};
|
|
25044
|
+
return InputEventScreenTouch;
|
|
25045
|
+
}(_wrap_native_super(InputEvent));
|
|
25046
|
+
var InputEventScreenDrag = /*#__PURE__*/ function(InputEvent) {
|
|
25047
|
+
_inherits(InputEventScreenDrag, InputEvent);
|
|
25048
|
+
function InputEventScreenDrag() {
|
|
25049
|
+
var _this;
|
|
25050
|
+
_this = InputEvent.apply(this, arguments) || this;
|
|
25051
|
+
_this.index = 0;
|
|
25052
|
+
_this.position = new Vector2();
|
|
25053
|
+
_this.relative = new Vector2();
|
|
25054
|
+
_this.screenRelative = new Vector2();
|
|
25055
|
+
_this.velocity = new Vector2();
|
|
25056
|
+
_this.screenVelocity = new Vector2();
|
|
25057
|
+
_this.pressure = 0;
|
|
25058
|
+
_this.tilt = new Vector2();
|
|
25059
|
+
_this.penInverted = false;
|
|
25060
|
+
return _this;
|
|
25061
|
+
}
|
|
25062
|
+
var _proto = InputEventScreenDrag.prototype;
|
|
25063
|
+
_proto.xformedBy = function xformedBy(transform) {
|
|
25064
|
+
var event = new InputEventScreenDrag();
|
|
25065
|
+
event.device = this.device;
|
|
25066
|
+
event.pressed = this.pressed;
|
|
25067
|
+
event.canceled = this.canceled;
|
|
25068
|
+
event.index = this.index;
|
|
25069
|
+
event.position.copyFrom(transformPoint(transform, this.position));
|
|
25070
|
+
event.relative.copyFrom(transformVector(transform, this.relative));
|
|
25071
|
+
event.screenRelative.copyFrom(this.screenRelative);
|
|
25072
|
+
event.velocity.copyFrom(transformVector(transform, this.velocity));
|
|
25073
|
+
event.screenVelocity.copyFrom(this.screenVelocity);
|
|
25074
|
+
event.pressure = this.pressure;
|
|
25075
|
+
event.tilt.copyFrom(this.tilt);
|
|
25076
|
+
event.penInverted = this.penInverted;
|
|
25077
|
+
return event;
|
|
25078
|
+
};
|
|
25079
|
+
return InputEventScreenDrag;
|
|
25080
|
+
}(_wrap_native_super(InputEvent));
|
|
25081
|
+
|
|
26654
25082
|
var EVENT_TYPE_CLICK = "click";
|
|
26655
25083
|
var EVENT_TYPE_TOUCH_START = "touchstart";
|
|
26656
25084
|
var EVENT_TYPE_TOUCH_MOVE = "touchmove";
|
|
@@ -26661,49 +25089,52 @@ var PointerEventType;
|
|
|
26661
25089
|
PointerEventType[PointerEventType["PointerUp"] = 1] = "PointerUp";
|
|
26662
25090
|
PointerEventType[PointerEventType["PointerMove"] = 2] = "PointerMove";
|
|
26663
25091
|
})(PointerEventType || (PointerEventType = {}));
|
|
26664
|
-
var EventSystem = /*#__PURE__*/ function() {
|
|
25092
|
+
var EventSystem = /*#__PURE__*/ function(EventEmitter) {
|
|
25093
|
+
_inherits(EventSystem, EventEmitter);
|
|
26665
25094
|
function EventSystem(engine, allowPropagation) {
|
|
26666
|
-
var _this = this;
|
|
26667
25095
|
if (allowPropagation === void 0) allowPropagation = false;
|
|
26668
|
-
|
|
26669
|
-
|
|
26670
|
-
|
|
26671
|
-
|
|
26672
|
-
|
|
26673
|
-
|
|
26674
|
-
|
|
26675
|
-
|
|
26676
|
-
|
|
26677
|
-
|
|
26678
|
-
|
|
26679
|
-
|
|
26680
|
-
|
|
26681
|
-
|
|
26682
|
-
|
|
26683
|
-
|
|
25096
|
+
var _this;
|
|
25097
|
+
_this = EventEmitter.call(this) || this;
|
|
25098
|
+
_this.engine = engine;
|
|
25099
|
+
_this.allowPropagation = allowPropagation;
|
|
25100
|
+
_this.skipPointerMovePicking = true;
|
|
25101
|
+
_this.emulateMouseFromTouch = true;
|
|
25102
|
+
_this.emulateTouchFromMouse = false;
|
|
25103
|
+
_this._enabled = true;
|
|
25104
|
+
_this.handlers = {};
|
|
25105
|
+
_this.nativeHandlers = [];
|
|
25106
|
+
_this.target = null;
|
|
25107
|
+
_this.mouseState = null;
|
|
25108
|
+
_this.mouseButtonMask = MouseButtonMask.None;
|
|
25109
|
+
_this.touchStates = new Map();
|
|
25110
|
+
_this.mouseFromTouchIndex = null;
|
|
25111
|
+
_this.touchFromMousePressed = false;
|
|
25112
|
+
_this.addedTabIndex = false;
|
|
25113
|
+
_this.addedOutlineStyle = false;
|
|
25114
|
+
_this.onNativeWheel = function(event) {
|
|
26684
25115
|
if (!_this.enabled || !_this.target) {
|
|
26685
25116
|
return;
|
|
26686
25117
|
}
|
|
26687
25118
|
var position = _this.getCanvasPosition(event.clientX, event.clientY);
|
|
26688
25119
|
var handled = false;
|
|
26689
25120
|
if (event.deltaY !== 0) {
|
|
26690
|
-
handled = _this.pushWheelButton(event.deltaY < 0 ? MouseButton.WheelUp : MouseButton.WheelDown,
|
|
25121
|
+
handled = _this.pushWheelButton(event.deltaY < 0 ? MouseButton.WheelUp : MouseButton.WheelDown, normalizeWheelFactor(event.deltaY, event.deltaMode), position, event) || handled;
|
|
26691
25122
|
}
|
|
26692
25123
|
if (event.deltaX !== 0) {
|
|
26693
|
-
handled = _this.pushWheelButton(event.deltaX < 0 ? MouseButton.WheelLeft : MouseButton.WheelRight,
|
|
25124
|
+
handled = _this.pushWheelButton(event.deltaX < 0 ? MouseButton.WheelLeft : MouseButton.WheelRight, normalizeWheelFactor(event.deltaX, event.deltaMode), position, event) || handled;
|
|
26694
25125
|
}
|
|
26695
25126
|
_this.consumeNativeEvent(event, handled);
|
|
26696
25127
|
};
|
|
26697
|
-
|
|
25128
|
+
_this.onNativeKeyDown = function(event) {
|
|
26698
25129
|
_this.handleNativeKey(event, true);
|
|
26699
25130
|
};
|
|
26700
|
-
|
|
25131
|
+
_this.onNativeKeyUp = function(event) {
|
|
26701
25132
|
_this.handleNativeKey(event, false);
|
|
26702
25133
|
};
|
|
26703
|
-
|
|
25134
|
+
_this.onNativeMouseDown = function(event) {
|
|
26704
25135
|
_this.handleNativeMouseDown(event);
|
|
26705
25136
|
};
|
|
26706
|
-
|
|
25137
|
+
_this.onNativeMouseMove = function(event) {
|
|
26707
25138
|
var _state;
|
|
26708
25139
|
if (!_this.enabled || !_this.target) {
|
|
26709
25140
|
return;
|
|
@@ -26715,18 +25146,22 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26715
25146
|
var relative = new Vector2(position.x - state.last.x, position.y - state.last.y);
|
|
26716
25147
|
var velocity = _this.getVelocity(state, position);
|
|
26717
25148
|
var handled = _this.pushNativeMouseMotion(event, position, relative, velocity);
|
|
26718
|
-
(_state = state).
|
|
26719
|
-
if (!handled && (!state.pressed || !state.
|
|
25149
|
+
(_state = state).inputHandled || (_state.inputHandled = handled);
|
|
25150
|
+
if (!handled && (!state.pressed || !state.inputHandled)) {
|
|
26720
25151
|
var pointerEvent = _this.createPointerEvent(event, position, state, velocity);
|
|
26721
25152
|
_this.dispatchEvent(EVENT_TYPE_TOUCH_MOVE, pointerEvent);
|
|
26722
25153
|
}
|
|
26723
25154
|
_this.updatePointerState(state, position);
|
|
26724
25155
|
_this.consumeNativeEvent(event, handled);
|
|
26725
25156
|
};
|
|
26726
|
-
|
|
25157
|
+
_this.onNativeMouseUp = function(event) {
|
|
26727
25158
|
if (!_this.enabled || !_this.target) {
|
|
26728
25159
|
return;
|
|
26729
25160
|
}
|
|
25161
|
+
// Keep the canonical mask in sync even when mouseState already ended on a
|
|
25162
|
+
// previous button release. The target and Window listeners may see the
|
|
25163
|
+
// same mouseup, but clearing a bit twice is intentionally idempotent.
|
|
25164
|
+
_this.setMouseButtonPressed(event.button, false);
|
|
26730
25165
|
var position = _this.getCanvasPosition(event.clientX, event.clientY);
|
|
26731
25166
|
var existingState = _this.mouseState;
|
|
26732
25167
|
if (!(existingState == null ? void 0 : existingState.pressed)) {
|
|
@@ -26735,16 +25170,16 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26735
25170
|
var state = existingState;
|
|
26736
25171
|
var handled = _this.pushNativeMouseButton(event, position, false);
|
|
26737
25172
|
var pointerEvent = _this.createPointerEvent(event, position, state);
|
|
26738
|
-
if (!state.
|
|
25173
|
+
if (!state.inputHandled && !handled && _this.isClick(state, position)) {
|
|
26739
25174
|
_this.dispatchEvent(EVENT_TYPE_CLICK, pointerEvent);
|
|
26740
25175
|
}
|
|
26741
|
-
if (!handled && !state.
|
|
25176
|
+
if (!handled && !state.inputHandled) {
|
|
26742
25177
|
_this.dispatchEvent(EVENT_TYPE_TOUCH_END, pointerEvent);
|
|
26743
25178
|
}
|
|
26744
25179
|
_this.mouseState = null;
|
|
26745
|
-
_this.consumeNativeEvent(event, handled || state.
|
|
25180
|
+
_this.consumeNativeEvent(event, handled || state.inputHandled || !_this.allowPropagation);
|
|
26746
25181
|
};
|
|
26747
|
-
|
|
25182
|
+
_this.onNativeTouchStart = function(event) {
|
|
26748
25183
|
if (!_this.enabled) {
|
|
26749
25184
|
return;
|
|
26750
25185
|
}
|
|
@@ -26756,7 +25191,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26756
25191
|
_this.touchStates.set(touch.identifier, state);
|
|
26757
25192
|
state.pressed = true;
|
|
26758
25193
|
var handled = _this.pushNativeScreenTouch(touch.identifier, position, true, false, false);
|
|
26759
|
-
state.
|
|
25194
|
+
state.inputHandled = handled;
|
|
26760
25195
|
if (!handled) {
|
|
26761
25196
|
var pointerEvent = _this.createPointerEvent(event, position, state);
|
|
26762
25197
|
_this.dispatchEvent(EVENT_TYPE_TOUCH_START, pointerEvent);
|
|
@@ -26765,7 +25200,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26765
25200
|
}
|
|
26766
25201
|
_this.preventTouchDefaults(event);
|
|
26767
25202
|
};
|
|
26768
|
-
|
|
25203
|
+
_this.onNativeTouchMove = function(event) {
|
|
26769
25204
|
if (!_this.enabled) {
|
|
26770
25205
|
return;
|
|
26771
25206
|
}
|
|
@@ -26779,8 +25214,8 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26779
25214
|
var relative = new Vector2(position.x - state.last.x, position.y - state.last.y);
|
|
26780
25215
|
var velocity = _this.getVelocity(state, position);
|
|
26781
25216
|
var handled = _this.pushNativeScreenDrag(touch.identifier, position, relative, velocity);
|
|
26782
|
-
(_state = state).
|
|
26783
|
-
if (!handled && !state.
|
|
25217
|
+
(_state = state).inputHandled || (_state.inputHandled = handled);
|
|
25218
|
+
if (!handled && !state.inputHandled) {
|
|
26784
25219
|
var pointerEvent = _this.createPointerEvent(event, position, state, velocity);
|
|
26785
25220
|
_this.dispatchEvent(EVENT_TYPE_TOUCH_MOVE, pointerEvent);
|
|
26786
25221
|
}
|
|
@@ -26789,24 +25224,26 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26789
25224
|
}
|
|
26790
25225
|
_this.preventTouchDefaults(event);
|
|
26791
25226
|
};
|
|
26792
|
-
|
|
25227
|
+
_this.onNativeTouchEnd = function(event) {
|
|
26793
25228
|
_this.handleNativeTouchEnd(event, false);
|
|
26794
25229
|
};
|
|
26795
|
-
|
|
25230
|
+
_this.onNativeTouchCancel = function(event) {
|
|
26796
25231
|
_this.handleNativeTouchEnd(event, true);
|
|
26797
25232
|
};
|
|
26798
|
-
|
|
26799
|
-
|
|
26800
|
-
_this.mouseState = null;
|
|
26801
|
-
_this.touchStates.clear();
|
|
26802
|
-
_this.mouseFromTouchIndex = null;
|
|
26803
|
-
_this.touchFromMousePressed = false;
|
|
26804
|
-
_this.engine.windowRoot.cancelPointerInput();
|
|
26805
|
-
}
|
|
25233
|
+
_this.onCanvasFocus = function() {
|
|
25234
|
+
_this.emit("canvasFocus");
|
|
26806
25235
|
};
|
|
25236
|
+
_this.onCanvasBlur = function() {
|
|
25237
|
+
_this.emit("canvasBlur");
|
|
25238
|
+
};
|
|
25239
|
+
return _this;
|
|
26807
25240
|
}
|
|
26808
25241
|
var _proto = EventSystem.prototype;
|
|
26809
|
-
|
|
25242
|
+
/**
|
|
25243
|
+
* Rebinds native input listeners to a canvas.
|
|
25244
|
+
*
|
|
25245
|
+
* Rebind or unbind only while there are no active key, mouse, touch, or drag sessions.
|
|
25246
|
+
*/ _proto.bindListeners = function bindListeners(target) {
|
|
26810
25247
|
this.unbindListeners();
|
|
26811
25248
|
this.target = target;
|
|
26812
25249
|
if (!target || typeof window === "undefined") {
|
|
@@ -26843,7 +25280,8 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26843
25280
|
});
|
|
26844
25281
|
this.addNativeHandler(target, "keydown", this.onNativeKeyDown);
|
|
26845
25282
|
this.addNativeHandler(target, "keyup", this.onNativeKeyUp);
|
|
26846
|
-
this.addNativeHandler(
|
|
25283
|
+
this.addNativeHandler(target, "focus", this.onCanvasFocus);
|
|
25284
|
+
this.addNativeHandler(target, "blur", this.onCanvasBlur);
|
|
26847
25285
|
};
|
|
26848
25286
|
_proto.dispatchEvent = function dispatchEvent(type, event) {
|
|
26849
25287
|
var handlers = this.handlers[type];
|
|
@@ -26877,11 +25315,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26877
25315
|
}
|
|
26878
25316
|
};
|
|
26879
25317
|
_proto.dispose = function dispose() {
|
|
26880
|
-
this.
|
|
26881
|
-
this.mouseState = null;
|
|
26882
|
-
this.touchStates.clear();
|
|
26883
|
-
this.mouseFromTouchIndex = null;
|
|
26884
|
-
this.touchFromMousePressed = false;
|
|
25318
|
+
this.resetInputState();
|
|
26885
25319
|
this.handlers = {};
|
|
26886
25320
|
this.unbindListeners();
|
|
26887
25321
|
this.target = null;
|
|
@@ -26890,13 +25324,14 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26890
25324
|
if (!this.enabled || !this.target) {
|
|
26891
25325
|
return;
|
|
26892
25326
|
}
|
|
25327
|
+
this.setMouseButtonPressed(event.button, true);
|
|
26893
25328
|
var position = this.getCanvasPosition(event.clientX, event.clientY);
|
|
26894
25329
|
this.focusTarget();
|
|
26895
25330
|
var state = this.createPointerState(position);
|
|
26896
25331
|
this.mouseState = state;
|
|
26897
25332
|
state.pressed = true;
|
|
26898
25333
|
var handled = this.pushNativeMouseButton(event, position, true);
|
|
26899
|
-
state.
|
|
25334
|
+
state.inputHandled = handled;
|
|
26900
25335
|
if (!handled) {
|
|
26901
25336
|
var pointerEvent = this.createPointerEvent(event, position, state);
|
|
26902
25337
|
this.dispatchEvent(EVENT_TYPE_TOUCH_START, pointerEvent);
|
|
@@ -26920,8 +25355,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26920
25355
|
input.altPressed = event.altKey;
|
|
26921
25356
|
input.metaPressed = event.metaKey;
|
|
26922
25357
|
input.ctrlPressed = event.ctrlKey;
|
|
26923
|
-
this.
|
|
26924
|
-
this.consumeNativeEvent(event, this.engine.windowRoot.isInputHandled());
|
|
25358
|
+
this.consumeNativeEvent(event, this.pushInput(input));
|
|
26925
25359
|
};
|
|
26926
25360
|
_proto.handleNativeTouchEnd = function handleNativeTouchEnd(event, canceled) {
|
|
26927
25361
|
if (!this.enabled) {
|
|
@@ -26936,14 +25370,14 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26936
25370
|
}
|
|
26937
25371
|
var handled = this.pushNativeScreenTouch(touch.identifier, position, false, canceled, false);
|
|
26938
25372
|
var pointerEvent = this.createPointerEvent(event, position, state);
|
|
26939
|
-
if (!canceled && !state.
|
|
25373
|
+
if (!canceled && !state.inputHandled && !handled && this.isClick(state, position)) {
|
|
26940
25374
|
this.dispatchEvent(EVENT_TYPE_CLICK, pointerEvent);
|
|
26941
25375
|
}
|
|
26942
|
-
if (!handled && !canceled && !state.
|
|
25376
|
+
if (!handled && !canceled && !state.inputHandled) {
|
|
26943
25377
|
this.dispatchEvent(EVENT_TYPE_TOUCH_END, pointerEvent);
|
|
26944
25378
|
}
|
|
26945
25379
|
this.touchStates.delete(touch.identifier);
|
|
26946
|
-
this.consumeNativeEvent(event, handled || state.
|
|
25380
|
+
this.consumeNativeEvent(event, handled || state.inputHandled || !this.allowPropagation);
|
|
26947
25381
|
}
|
|
26948
25382
|
this.preventTouchDefaults(event);
|
|
26949
25383
|
};
|
|
@@ -26963,7 +25397,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
26963
25397
|
};
|
|
26964
25398
|
_proto.pushNativeMouseMotion = function pushNativeMouseMotion(event, position, relative, velocity) {
|
|
26965
25399
|
var handled = false;
|
|
26966
|
-
if (this.touchFromMousePressed && (
|
|
25400
|
+
if (this.touchFromMousePressed && (this.mouseButtonMask & MouseButtonMask.Left) !== 0) {
|
|
26967
25401
|
handled = this.pushScreenDrag(0, position, relative, velocity, InputEvent.deviceIdEmulation);
|
|
26968
25402
|
}
|
|
26969
25403
|
return this.pushMouseMotion(event, position, relative, velocity) || handled;
|
|
@@ -27000,8 +25434,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27000
25434
|
input.pressed = pressed;
|
|
27001
25435
|
input.canceled = canceled;
|
|
27002
25436
|
input.doubleClick = doubleClick;
|
|
27003
|
-
this.
|
|
27004
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25437
|
+
return this.pushInput(input);
|
|
27005
25438
|
};
|
|
27006
25439
|
_proto.pushEmulatedMouseMotion = function pushEmulatedMouseMotion(position, relative, velocity) {
|
|
27007
25440
|
var input = new InputEventMouseMotion();
|
|
@@ -27014,42 +25447,42 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27014
25447
|
input.screenRelative.copyFrom(relative);
|
|
27015
25448
|
input.velocity.copyFrom(velocity);
|
|
27016
25449
|
input.screenVelocity.copyFrom(velocity);
|
|
27017
|
-
this.
|
|
27018
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25450
|
+
return this.pushInput(input);
|
|
27019
25451
|
};
|
|
27020
25452
|
_proto.pushMouseButton = function pushMouseButton(event, position, pressed) {
|
|
27021
25453
|
var input = new InputEventMouseButton();
|
|
27022
25454
|
this.copyMouseFields(input, event, position);
|
|
27023
25455
|
input.device = InputEvent.deviceIdMouse;
|
|
27024
25456
|
input.buttonIndex = getMouseButton(event.button);
|
|
27025
|
-
input.buttonMask =
|
|
25457
|
+
input.buttonMask = this.mouseButtonMask;
|
|
25458
|
+
input.pressed = pressed;
|
|
25459
|
+
input.doubleClick = event.detail > 1;
|
|
25460
|
+
return this.pushInput(input);
|
|
25461
|
+
};
|
|
25462
|
+
_proto.setMouseButtonPressed = function setMouseButtonPressed(button, pressed) {
|
|
25463
|
+
var buttonBit = getMouseButtonBit(getMouseButton(button));
|
|
27026
25464
|
if (pressed) {
|
|
27027
|
-
|
|
25465
|
+
this.mouseButtonMask |= buttonBit;
|
|
27028
25466
|
} else {
|
|
27029
|
-
|
|
25467
|
+
this.mouseButtonMask &= ~buttonBit;
|
|
27030
25468
|
}
|
|
27031
|
-
input.pressed = pressed;
|
|
27032
|
-
input.doubleClick = event.detail > 1;
|
|
27033
|
-
this.engine.windowRoot.pushInput(input);
|
|
27034
|
-
return this.engine.windowRoot.isInputHandled();
|
|
27035
25469
|
};
|
|
27036
25470
|
_proto.pushWheelButton = function pushWheelButton(button, factor, position, event) {
|
|
27037
25471
|
var input = new InputEventMouseButton();
|
|
27038
25472
|
this.copyMouseFields(input, event, position);
|
|
27039
25473
|
input.device = InputEvent.deviceIdMouse;
|
|
27040
25474
|
input.buttonIndex = button;
|
|
27041
|
-
input.buttonMask =
|
|
25475
|
+
input.buttonMask = this.mouseButtonMask;
|
|
27042
25476
|
input.factor = factor;
|
|
27043
25477
|
input.pressed = true;
|
|
27044
|
-
this.
|
|
27045
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25478
|
+
return this.pushInput(input);
|
|
27046
25479
|
};
|
|
27047
25480
|
_proto.pushMouseMotion = function pushMouseMotion(event, position, relative, velocity) {
|
|
27048
25481
|
var input = new InputEventMouseMotion();
|
|
27049
25482
|
this.copyMouseFields(input, event, position);
|
|
27050
25483
|
input.device = InputEvent.deviceIdMouse;
|
|
27051
|
-
input.buttonMask =
|
|
27052
|
-
input.pressed =
|
|
25484
|
+
input.buttonMask = this.mouseButtonMask;
|
|
25485
|
+
input.pressed = this.mouseButtonMask !== MouseButtonMask.None;
|
|
27053
25486
|
input.relative.copyFrom(relative);
|
|
27054
25487
|
input.screenRelative.copyFrom(relative);
|
|
27055
25488
|
input.velocity.copyFrom(velocity);
|
|
@@ -27058,8 +25491,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27058
25491
|
input.pressure = event.pressure;
|
|
27059
25492
|
input.tilt.set(event.tiltX, event.tiltY);
|
|
27060
25493
|
}
|
|
27061
|
-
this.
|
|
27062
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25494
|
+
return this.pushInput(input);
|
|
27063
25495
|
};
|
|
27064
25496
|
_proto.pushScreenTouch = function pushScreenTouch(index, position, pressed, canceled, doubleTap, device) {
|
|
27065
25497
|
var input = new InputEventScreenTouch();
|
|
@@ -27069,8 +25501,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27069
25501
|
input.pressed = pressed;
|
|
27070
25502
|
input.canceled = canceled;
|
|
27071
25503
|
input.doubleTap = doubleTap;
|
|
27072
|
-
this.
|
|
27073
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25504
|
+
return this.pushInput(input);
|
|
27074
25505
|
};
|
|
27075
25506
|
_proto.pushScreenDrag = function pushScreenDrag(index, position, relative, velocity, device) {
|
|
27076
25507
|
var input = new InputEventScreenDrag();
|
|
@@ -27082,8 +25513,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27082
25513
|
input.velocity.copyFrom(velocity);
|
|
27083
25514
|
input.screenVelocity.copyFrom(velocity);
|
|
27084
25515
|
input.pressed = true;
|
|
27085
|
-
this.
|
|
27086
|
-
return this.engine.windowRoot.isInputHandled();
|
|
25516
|
+
return this.pushInput(input);
|
|
27087
25517
|
};
|
|
27088
25518
|
_proto.copyMouseFields = function copyMouseFields(input, event, position) {
|
|
27089
25519
|
input.position.copyFrom(position);
|
|
@@ -27158,7 +25588,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27158
25588
|
start: position.clone(),
|
|
27159
25589
|
last: position.clone(),
|
|
27160
25590
|
lastTime: performance.now(),
|
|
27161
|
-
|
|
25591
|
+
inputHandled: false,
|
|
27162
25592
|
pressed: false
|
|
27163
25593
|
};
|
|
27164
25594
|
return state;
|
|
@@ -27183,8 +25613,8 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27183
25613
|
var _target_width, _target_height;
|
|
27184
25614
|
return {
|
|
27185
25615
|
x: position.x / cssWidth * 2 - 1,
|
|
27186
|
-
// Legacy composition picking uses bottom-left, Y-up NDC even though
|
|
27187
|
-
// input follows the DOM convention of top-left, Y-down pixels.
|
|
25616
|
+
// Legacy composition picking uses bottom-left, Y-up NDC even though
|
|
25617
|
+
// standardized input follows the DOM convention of top-left, Y-down pixels.
|
|
27188
25618
|
y: 1 - position.y / cssHeight * 2,
|
|
27189
25619
|
vx: velocity.x / cssWidth * 2,
|
|
27190
25620
|
vy: -velocity.y / cssHeight * 2,
|
|
@@ -27212,6 +25642,11 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27212
25642
|
event.stopPropagation();
|
|
27213
25643
|
}
|
|
27214
25644
|
};
|
|
25645
|
+
_proto.pushInput = function pushInput(input) {
|
|
25646
|
+
input.clearAccepted();
|
|
25647
|
+
this.emit("input", input);
|
|
25648
|
+
return input.isAccepted();
|
|
25649
|
+
};
|
|
27215
25650
|
_proto.preventTouchDefaults = function preventTouchDefaults(event) {
|
|
27216
25651
|
if (event.cancelable) {
|
|
27217
25652
|
event.preventDefault();
|
|
@@ -27221,6 +25656,13 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27221
25656
|
var _this_target;
|
|
27222
25657
|
(_this_target = this.target) == null ? void 0 : _this_target.focus();
|
|
27223
25658
|
};
|
|
25659
|
+
_proto.resetInputState = function resetInputState() {
|
|
25660
|
+
this.mouseState = null;
|
|
25661
|
+
this.mouseButtonMask = MouseButtonMask.None;
|
|
25662
|
+
this.touchStates.clear();
|
|
25663
|
+
this.mouseFromTouchIndex = null;
|
|
25664
|
+
this.touchFromMousePressed = false;
|
|
25665
|
+
};
|
|
27224
25666
|
_proto.addNativeHandler = function addNativeHandler(target, name, handler, options) {
|
|
27225
25667
|
target.addEventListener(name, handler, options);
|
|
27226
25668
|
this.nativeHandlers.push({
|
|
@@ -27251,23 +25693,20 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
27251
25693
|
get: function get() {
|
|
27252
25694
|
return this._enabled;
|
|
27253
25695
|
},
|
|
27254
|
-
set:
|
|
25696
|
+
set: /**
|
|
25697
|
+
* Enables native input processing.
|
|
25698
|
+
*
|
|
25699
|
+
* Change this only while there are no active key, mouse, touch, or drag sessions.
|
|
25700
|
+
*/ function set(value) {
|
|
27255
25701
|
if (this._enabled === value) {
|
|
27256
25702
|
return;
|
|
27257
25703
|
}
|
|
27258
25704
|
this._enabled = value;
|
|
27259
|
-
if (!value) {
|
|
27260
|
-
this.mouseState = null;
|
|
27261
|
-
this.touchStates.clear();
|
|
27262
|
-
this.mouseFromTouchIndex = null;
|
|
27263
|
-
this.touchFromMousePressed = false;
|
|
27264
|
-
this.engine.windowRoot.cancelPointerInput();
|
|
27265
|
-
}
|
|
27266
25705
|
}
|
|
27267
25706
|
}
|
|
27268
25707
|
]);
|
|
27269
25708
|
return EventSystem;
|
|
27270
|
-
}();
|
|
25709
|
+
}(EventEmitter);
|
|
27271
25710
|
function getKeyLocation(location) {
|
|
27272
25711
|
if (location === 1) {
|
|
27273
25712
|
return KeyLocation.Left;
|
|
@@ -27298,25 +25737,6 @@ function getMouseButton(button) {
|
|
|
27298
25737
|
return MouseButton.None;
|
|
27299
25738
|
}
|
|
27300
25739
|
}
|
|
27301
|
-
function getMouseButtonMask(buttons) {
|
|
27302
|
-
var mask = MouseButtonMask.None;
|
|
27303
|
-
if ((buttons & 1) !== 0) {
|
|
27304
|
-
mask |= MouseButtonMask.Left;
|
|
27305
|
-
}
|
|
27306
|
-
if ((buttons & 2) !== 0) {
|
|
27307
|
-
mask |= MouseButtonMask.Right;
|
|
27308
|
-
}
|
|
27309
|
-
if ((buttons & 4) !== 0) {
|
|
27310
|
-
mask |= MouseButtonMask.Middle;
|
|
27311
|
-
}
|
|
27312
|
-
if ((buttons & 8) !== 0) {
|
|
27313
|
-
mask |= MouseButtonMask.Xbutton1;
|
|
27314
|
-
}
|
|
27315
|
-
if ((buttons & 16) !== 0) {
|
|
27316
|
-
mask |= MouseButtonMask.Xbutton2;
|
|
27317
|
-
}
|
|
27318
|
-
return mask;
|
|
27319
|
-
}
|
|
27320
25740
|
function getMouseButtonBit(button) {
|
|
27321
25741
|
switch(button){
|
|
27322
25742
|
case MouseButton.Left:
|
|
@@ -27333,6 +25753,16 @@ function getMouseButtonBit(button) {
|
|
|
27333
25753
|
return MouseButtonMask.None;
|
|
27334
25754
|
}
|
|
27335
25755
|
}
|
|
25756
|
+
function normalizeWheelFactor(delta, mode) {
|
|
25757
|
+
var magnitude = Math.abs(delta);
|
|
25758
|
+
if (mode === 1) {
|
|
25759
|
+
return magnitude / 3;
|
|
25760
|
+
}
|
|
25761
|
+
if (mode === 2) {
|
|
25762
|
+
return magnitude;
|
|
25763
|
+
}
|
|
25764
|
+
return magnitude / 100;
|
|
25765
|
+
}
|
|
27336
25766
|
|
|
27337
25767
|
var InteractLoader = /*#__PURE__*/ function(Plugin) {
|
|
27338
25768
|
_inherits(InteractLoader, Plugin);
|
|
@@ -29352,6 +27782,11 @@ SpritePropertyTrack = __decorate([
|
|
|
29352
27782
|
effectsClass("SpritePropertyTrack")
|
|
29353
27783
|
], SpritePropertyTrack);
|
|
29354
27784
|
|
|
27785
|
+
function _assert_this_initialized(self) {
|
|
27786
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
27787
|
+
return self;
|
|
27788
|
+
}
|
|
27789
|
+
|
|
29355
27790
|
var Cone = /*#__PURE__*/ function() {
|
|
29356
27791
|
function Cone(props) {
|
|
29357
27792
|
var _this = this;
|
|
@@ -39356,7 +37791,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
39356
37791
|
return ret;
|
|
39357
37792
|
}
|
|
39358
37793
|
|
|
39359
|
-
var version$2 = "2.10.0-alpha.
|
|
37794
|
+
var version$2 = "2.10.0-alpha.5";
|
|
39360
37795
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
39361
37796
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
39362
37797
|
var reverseParticle = false;
|
|
@@ -41352,9 +39787,11 @@ var PreRenderTickData = /*#__PURE__*/ function(TickData) {
|
|
|
41352
39787
|
// Instantiate composition rootItem
|
|
41353
39788
|
_this.sceneRoot = new VFXItem(_this.engine);
|
|
41354
39789
|
_this.sceneRoot.setParent(_this.root);
|
|
41355
|
-
_this.uiCanvas = _this.sceneRoot.addComponent(UICanvas);
|
|
41356
39790
|
if (sourceContent) {
|
|
41357
39791
|
_this.sceneRoot.setInstanceId(sourceContent.id);
|
|
39792
|
+
}
|
|
39793
|
+
PluginSystem.notifyCompositionCreating(_assert_this_initialized(_this), scene);
|
|
39794
|
+
if (sourceContent) {
|
|
41358
39795
|
_this.sceneRoot.instantiatePreComposition(sourceContent, false);
|
|
41359
39796
|
}
|
|
41360
39797
|
// 在 instantiatePreComposition 后设置 rootItem 的 name,避免 name 被覆盖
|
|
@@ -41923,9 +40360,6 @@ var PreRenderTickData = /*#__PURE__*/ function(TickData) {
|
|
|
41923
40360
|
},
|
|
41924
40361
|
set: function set(value) {
|
|
41925
40362
|
this._renderOrder = value;
|
|
41926
|
-
if (this.uiCanvas) {
|
|
41927
|
-
this.uiCanvas.order = value;
|
|
41928
|
-
}
|
|
41929
40363
|
}
|
|
41930
40364
|
},
|
|
41931
40365
|
{
|
|
@@ -41938,9 +40372,6 @@ var PreRenderTickData = /*#__PURE__*/ function(TickData) {
|
|
|
41938
40372
|
},
|
|
41939
40373
|
set: function set(value) {
|
|
41940
40374
|
this._interactive = !!value;
|
|
41941
|
-
if (this.uiCanvas) {
|
|
41942
|
-
this.uiCanvas.receivesEvents = this._interactive;
|
|
41943
|
-
}
|
|
41944
40375
|
}
|
|
41945
40376
|
},
|
|
41946
40377
|
{
|
|
@@ -43768,7 +42199,6 @@ var DEFAULT_FPS = 60;
|
|
|
43768
42199
|
_this.objectInstance = {};
|
|
43769
42200
|
_this.root = new VFXItem(_assert_this_initialized(_this));
|
|
43770
42201
|
_this.root.name = "root";
|
|
43771
|
-
_this.windowRoot = new WindowRootControl(_assert_this_initialized(_this));
|
|
43772
42202
|
_this.whiteTexture = generateWhiteTexture(_assert_this_initialized(_this));
|
|
43773
42203
|
_this.transparentTexture = generateEmptyTexture(_assert_this_initialized(_this));
|
|
43774
42204
|
if (!(options == null ? void 0 : options.manualRender)) {
|
|
@@ -43921,7 +42351,7 @@ var DEFAULT_FPS = 60;
|
|
|
43921
42351
|
(_this_ticker1 = this.ticker) == null ? void 0 : _this_ticker1.pause();
|
|
43922
42352
|
return;
|
|
43923
42353
|
}
|
|
43924
|
-
this.
|
|
42354
|
+
this.emit("update", dt);
|
|
43925
42355
|
// Tick compositions onPreRender
|
|
43926
42356
|
//-------------------------------------------------------------------------
|
|
43927
42357
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(compositions), _step1; !(_step1 = _iterator1()).done;){
|
|
@@ -43936,7 +42366,7 @@ var DEFAULT_FPS = 60;
|
|
|
43936
42366
|
var composition2 = _step2.value;
|
|
43937
42367
|
composition2.renderContent();
|
|
43938
42368
|
}
|
|
43939
|
-
this.
|
|
42369
|
+
this.emit("postrender");
|
|
43940
42370
|
this.renderTargetPool.flush();
|
|
43941
42371
|
};
|
|
43942
42372
|
/**
|
|
@@ -43978,7 +42408,6 @@ var DEFAULT_FPS = 60;
|
|
|
43978
42408
|
this.canvas.style.height = containerHeight + "px";
|
|
43979
42409
|
logger.info("Resize engine " + this.name + " [" + canvasWidth + "," + canvasHeight + "," + containerWidth + "," + containerHeight + "].");
|
|
43980
42410
|
this.setSize(canvasWidth, canvasHeight);
|
|
43981
|
-
this.windowRoot.resize(canvasWidth, canvasHeight);
|
|
43982
42411
|
}
|
|
43983
42412
|
};
|
|
43984
42413
|
_proto.setSize = function setSize(width, height) {
|
|
@@ -44184,6 +42613,12 @@ var DEFAULT_FPS = 60;
|
|
|
44184
42613
|
_proto.setStencilTest = function setStencilTest(enable) {
|
|
44185
42614
|
// OVERRIDE
|
|
44186
42615
|
};
|
|
42616
|
+
_proto.setScissorTest = function setScissorTest(enable) {
|
|
42617
|
+
// OVERRIDE
|
|
42618
|
+
};
|
|
42619
|
+
_proto.setScissor = function setScissor(x, y, width, height) {
|
|
42620
|
+
// OVERRIDE
|
|
42621
|
+
};
|
|
44187
42622
|
_proto.setCulling = function setCulling(enable) {
|
|
44188
42623
|
// OVERRIDE
|
|
44189
42624
|
};
|
|
@@ -44261,7 +42696,6 @@ var DEFAULT_FPS = 60;
|
|
|
44261
42696
|
composition.dispose();
|
|
44262
42697
|
}
|
|
44263
42698
|
this.root.dispose();
|
|
44264
|
-
this.windowRoot.dispose();
|
|
44265
42699
|
(_this_assetService = this.assetService) == null ? void 0 : _this_assetService.dispose();
|
|
44266
42700
|
(_this__graphics = this._graphics) == null ? void 0 : _this__graphics.dispose();
|
|
44267
42701
|
this.renderPasses.forEach(function(pass) {
|
|
@@ -44586,7 +43020,7 @@ registerPlugin("text", TextLoader);
|
|
|
44586
43020
|
registerPlugin("sprite", SpriteLoader);
|
|
44587
43021
|
registerPlugin("particle", ParticleLoader);
|
|
44588
43022
|
registerPlugin("interact", InteractLoader);
|
|
44589
|
-
var version$1 = "2.10.0-alpha.
|
|
43023
|
+
var version$1 = "2.10.0-alpha.5";
|
|
44590
43024
|
logger.info("Core version: " + version$1 + ".");
|
|
44591
43025
|
|
|
44592
43026
|
var _obj;
|
|
@@ -46079,8 +44513,8 @@ applyMixins(ThreeTextComponent, [
|
|
|
46079
44513
|
*/ Mesh.create = function(engine, props) {
|
|
46080
44514
|
return new ThreeMesh(engine, props);
|
|
46081
44515
|
};
|
|
46082
|
-
var version = "2.10.0-alpha.
|
|
44516
|
+
var version = "2.10.0-alpha.5";
|
|
46083
44517
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
46084
44518
|
|
|
46085
|
-
export { ATLAS_SIZE, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationEvent, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BezierDataMap, BezierEasing, BezierLengthData, BezierMap, BezierPath, BezierQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, BoundingBoxInfo, Buffer, BufferDataType, BufferUsage, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, Camera, CameraController, CameraVFXItemLoader,
|
|
44519
|
+
export { ATLAS_SIZE, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationEvent, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BezierDataMap, BezierEasing, BezierLengthData, BezierMap, BezierPath, BezierQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, BoundingBoxInfo, Buffer, BufferDataType, BufferUsage, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, Camera, CameraController, CameraVFXItemLoader, Circle$1 as Circle, ColorCurve, ColorPlayable, ColorPropertyMixerPlayable, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, ComponentTimePlayable, ComponentTimePlayableAsset, ComponentTimeTrack, Composition, CompositionComponent, CompressTextureCapabilityType, ConstBoolNode, ConstBoolNodeData, ConstFloatNode, ConstFloatNodeData, ConstraintTarget, ControlParameterBoolNode, ControlParameterBoolNodeData, ControlParameterFloatNode, ControlParameterFloatNodeData, ControlParameterTriggerNode, ControlParameterTriggerNodeData, DEFAULT_FONTS, DEFAULT_FPS, DataBuffer, Database, Deferred, DestroyOptions, Downloader, DrawObjectPass, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectComponentTimeTrack, EffectsObject, EffectsPackage, Ellipse, Engine, EqualNodeData, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatComparisonNode, FloatComparisonNodeData, FloatPropertyMixerPlayable, FloatPropertyPlayableAsset, FloatPropertyTrack, FloatValueNode, FrameComponent, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GlyphAtlas, GradientValue, GraphInstance, GraphNode, GraphNodeData, Graphics, GreaterNodeData, HELP_LINK, HitTestType, InputEvent, InputEventKey, InputEventMouse, InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch, InputEventWithModifiers, InteractComponent, InteractLoader, InteractMesh, InvalidIndex, Item, KeyLocation, LayerBlendNode, LayerBlendNodeData, LessNodeData, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskableGraphic, Material, MaterialDataBlock, MaterialRenderType, MaterialState, MaterialTrack, Mesh, MouseButton, MouseButtonMask, NodeTransform, NotNode, NotNodeData, NotifyEvent, ObjectBindingTrack, OrNode, OrNodeData, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleMixerPlayable, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PlayState, Playable, PlayableAsset, PlayableOutput, Plugin, PluginSystem, PointerEventData, PointerEventType, PolyStar, Polygon, Pose, PoseNode, PositionConstraint, PostProcessVolume, Precomposition, PrecompositionManager, PropertyClipPlayable, PropertyTrack, REFERENCE_CURVE, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RaycastResult, Rectangle$1 as Rectangle, ReferenceCurve, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTargetPool, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SceneLoader, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SourceType, Sprite, SpriteColorMixerPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteComponentTimeTrack, SpriteLoader, SpritePropertyMixerPlayable, SpritePropertyPlayableAsset, SpritePropertyTrack, SpriteRotation, StarType, StateMachineNode, StateMachineNodeData, StateNode, StateNodeData, StaticValue, SubCompositionClipPlayable, SubCompositionMixerPlayable, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TangentMode, TextCache, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TexturePaintScaleMode, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelineInstance, TrackAsset, TrackMixerPlayable, TrackType, Transform, TransformMixerPlayable, TransformPlayable, TransformPlayableAsset, TransformTrack, TransitionNode, TransitionNodeData, TransitionState, Triangle, TrimPath, TrimPathMode, UpdateModes, VFXItem, ValueGetter, ValueNode, Vector2Curve, Vector2PropertyMixerPlayable, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector3Curve, Vector3PropertyMixerPlayable, Vector3PropertyTrack, Vector3ropertyPlayableAsset, Vector4Curve, Vector4PropertyMixerPlayable, Vector4PropertyPlayableAsset, Vector4PropertyTrack, VertexBuffer, WeightedMode, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, breakOpportunityAfter, buildBezierData, buildEasingCurve, buildLine, calculateTranslation, canUseBOM, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createGLContext, createKeyFrameMeta, createShape, createTypedArray, createValueGetter, curveEps, decimalEqual, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, extractMinAndMax, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTexture, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateWhiteTexture, getBackgroundImage, getBytesPerElement, getClass, getColorFromGradientStops, getConfig, getControlPoints, getDataByteLength, getDataType, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getKeyFrameMetaByRawValue, getMergedStore, getNodeDataClass, getParticleMeshShader, getPixelRatio, getPluginUsageInfo, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isBreakChar, isCJKLike, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isOpenHarmony, isPlainObject, isPowerOfTwo, isSafeFontFamily, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, modifyMaxKeyframeShader, nearestPowerOfTwo, nodeDataClass, noop, normalizeColor, numberToFix, oldBezierKeyFramesToNew, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setRayFromCamera, setSideMode, setUniformValue, sortByOrder, index$1 as spec, textureLoaderRegistry, thresholdFrag, throwDestroyedError, toBufferView, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|
|
46086
44520
|
//# sourceMappingURL=index.mjs.map
|