modern-canvas 0.1.0 → 0.1.1
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/README.md +22 -14
- package/dist/index.cjs +212 -250
- package/dist/index.d.cts +34 -34
- package/dist/index.d.mts +34 -34
- package/dist/index.d.ts +34 -34
- package/dist/index.js +27 -27
- package/dist/index.mjs +213 -251
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -616,13 +616,13 @@ class Geometry extends Resource {
|
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
var __defProp$
|
|
620
|
-
var __decorateClass$
|
|
619
|
+
var __defProp$B = Object.defineProperty;
|
|
620
|
+
var __decorateClass$B = (decorators, target, key, kind) => {
|
|
621
621
|
var result = void 0 ;
|
|
622
622
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
623
623
|
if (decorator = decorators[i])
|
|
624
624
|
result = (decorator(target, key, result) ) || result;
|
|
625
|
-
if (result) __defProp$
|
|
625
|
+
if (result) __defProp$B(target, key, result);
|
|
626
626
|
return result;
|
|
627
627
|
};
|
|
628
628
|
class IndexBuffer extends Resource {
|
|
@@ -666,20 +666,20 @@ class IndexBuffer extends Resource {
|
|
|
666
666
|
return result;
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
__decorateClass$
|
|
669
|
+
__decorateClass$B([
|
|
670
670
|
protectedProperty({ default: null })
|
|
671
671
|
], IndexBuffer.prototype, "data");
|
|
672
|
-
__decorateClass$
|
|
672
|
+
__decorateClass$B([
|
|
673
673
|
protectedProperty({ default: false })
|
|
674
674
|
], IndexBuffer.prototype, "dynamic");
|
|
675
675
|
|
|
676
|
-
var __defProp$
|
|
677
|
-
var __decorateClass$
|
|
676
|
+
var __defProp$A = Object.defineProperty;
|
|
677
|
+
var __decorateClass$A = (decorators, target, key, kind) => {
|
|
678
678
|
var result = void 0 ;
|
|
679
679
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
680
680
|
if (decorator = decorators[i])
|
|
681
681
|
result = (decorator(target, key, result) ) || result;
|
|
682
|
-
if (result) __defProp$
|
|
682
|
+
if (result) __defProp$A(target, key, result);
|
|
683
683
|
return result;
|
|
684
684
|
};
|
|
685
685
|
class VertexBuffer extends Resource {
|
|
@@ -723,20 +723,20 @@ class VertexBuffer extends Resource {
|
|
|
723
723
|
return result;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
__decorateClass$
|
|
726
|
+
__decorateClass$A([
|
|
727
727
|
protectedProperty({ default: null })
|
|
728
728
|
], VertexBuffer.prototype, "data");
|
|
729
|
-
__decorateClass$
|
|
729
|
+
__decorateClass$A([
|
|
730
730
|
protectedProperty({ default: false })
|
|
731
731
|
], VertexBuffer.prototype, "dynamic");
|
|
732
732
|
|
|
733
|
-
var __defProp$
|
|
734
|
-
var __decorateClass$
|
|
733
|
+
var __defProp$z = Object.defineProperty;
|
|
734
|
+
var __decorateClass$z = (decorators, target, key, kind) => {
|
|
735
735
|
var result = void 0 ;
|
|
736
736
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
737
737
|
if (decorator = decorators[i])
|
|
738
738
|
result = (decorator(target, key, result) ) || result;
|
|
739
|
-
if (result) __defProp$
|
|
739
|
+
if (result) __defProp$z(target, key, result);
|
|
740
740
|
return result;
|
|
741
741
|
};
|
|
742
742
|
class VertexAttribute extends Resource {
|
|
@@ -773,25 +773,25 @@ class VertexAttribute extends Resource {
|
|
|
773
773
|
return result;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
__decorateClass$
|
|
776
|
+
__decorateClass$z([
|
|
777
777
|
protectedProperty()
|
|
778
778
|
], VertexAttribute.prototype, "buffer");
|
|
779
|
-
__decorateClass$
|
|
779
|
+
__decorateClass$z([
|
|
780
780
|
protectedProperty({ default: 0 })
|
|
781
781
|
], VertexAttribute.prototype, "size");
|
|
782
|
-
__decorateClass$
|
|
782
|
+
__decorateClass$z([
|
|
783
783
|
protectedProperty({ default: false })
|
|
784
784
|
], VertexAttribute.prototype, "normalized");
|
|
785
|
-
__decorateClass$
|
|
785
|
+
__decorateClass$z([
|
|
786
786
|
protectedProperty({ default: "float" })
|
|
787
787
|
], VertexAttribute.prototype, "type");
|
|
788
|
-
__decorateClass$
|
|
788
|
+
__decorateClass$z([
|
|
789
789
|
protectedProperty()
|
|
790
790
|
], VertexAttribute.prototype, "stride");
|
|
791
|
-
__decorateClass$
|
|
791
|
+
__decorateClass$z([
|
|
792
792
|
protectedProperty()
|
|
793
793
|
], VertexAttribute.prototype, "offset");
|
|
794
|
-
__decorateClass$
|
|
794
|
+
__decorateClass$z([
|
|
795
795
|
protectedProperty()
|
|
796
796
|
], VertexAttribute.prototype, "divisor");
|
|
797
797
|
|
|
@@ -975,13 +975,13 @@ class UvGeometry extends Geometry {
|
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
|
|
978
|
-
var __defProp$
|
|
979
|
-
var __decorateClass$
|
|
978
|
+
var __defProp$y = Object.defineProperty;
|
|
979
|
+
var __decorateClass$y = (decorators, target, key, kind) => {
|
|
980
980
|
var result = void 0 ;
|
|
981
981
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
982
982
|
if (decorator = decorators[i])
|
|
983
983
|
result = (decorator(target, key, result) ) || result;
|
|
984
|
-
if (result) __defProp$
|
|
984
|
+
if (result) __defProp$y(target, key, result);
|
|
985
985
|
return result;
|
|
986
986
|
};
|
|
987
987
|
class MainLoop extends _Object {
|
|
@@ -1022,10 +1022,10 @@ class MainLoop extends _Object {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
__decorateClass$
|
|
1025
|
+
__decorateClass$y([
|
|
1026
1026
|
property({ default: 24 })
|
|
1027
1027
|
], MainLoop.prototype, "fps");
|
|
1028
|
-
__decorateClass$
|
|
1028
|
+
__decorateClass$y([
|
|
1029
1029
|
property({ default: 1 })
|
|
1030
1030
|
], MainLoop.prototype, "speed");
|
|
1031
1031
|
|
|
@@ -3998,14 +3998,14 @@ class Vector4 extends Vector {
|
|
|
3998
3998
|
}
|
|
3999
3999
|
}
|
|
4000
4000
|
|
|
4001
|
-
var __defProp$
|
|
4002
|
-
var __getOwnPropDesc$
|
|
4003
|
-
var __decorateClass$
|
|
4004
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4001
|
+
var __defProp$x = Object.defineProperty;
|
|
4002
|
+
var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
|
|
4003
|
+
var __decorateClass$x = (decorators, target, key, kind) => {
|
|
4004
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
|
|
4005
4005
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4006
4006
|
if (decorator = decorators[i])
|
|
4007
4007
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4008
|
-
if (kind && result) __defProp$
|
|
4008
|
+
if (kind && result) __defProp$x(target, key, result);
|
|
4009
4009
|
return result;
|
|
4010
4010
|
};
|
|
4011
4011
|
var InternalMode = /* @__PURE__ */ ((InternalMode2) => {
|
|
@@ -4403,22 +4403,22 @@ let Node = class extends Reference {
|
|
|
4403
4403
|
return node;
|
|
4404
4404
|
}
|
|
4405
4405
|
};
|
|
4406
|
-
__decorateClass$
|
|
4406
|
+
__decorateClass$x([
|
|
4407
4407
|
property()
|
|
4408
4408
|
], Node.prototype, "name", 2);
|
|
4409
|
-
__decorateClass$
|
|
4409
|
+
__decorateClass$x([
|
|
4410
4410
|
property()
|
|
4411
4411
|
], Node.prototype, "mask", 2);
|
|
4412
|
-
__decorateClass$
|
|
4412
|
+
__decorateClass$x([
|
|
4413
4413
|
property({ default: "visible" })
|
|
4414
4414
|
], Node.prototype, "visibility", 2);
|
|
4415
|
-
__decorateClass$
|
|
4415
|
+
__decorateClass$x([
|
|
4416
4416
|
property({ default: 0 })
|
|
4417
4417
|
], Node.prototype, "visibleDelay", 2);
|
|
4418
|
-
__decorateClass$
|
|
4418
|
+
__decorateClass$x([
|
|
4419
4419
|
property({ default: Number.MAX_SAFE_INTEGER })
|
|
4420
4420
|
], Node.prototype, "visibleDuration", 2);
|
|
4421
|
-
Node = __decorateClass$
|
|
4421
|
+
Node = __decorateClass$x([
|
|
4422
4422
|
customNode("Node")
|
|
4423
4423
|
], Node);
|
|
4424
4424
|
|
|
@@ -4448,14 +4448,14 @@ class RenderStack {
|
|
|
4448
4448
|
}
|
|
4449
4449
|
}
|
|
4450
4450
|
|
|
4451
|
-
var __defProp$
|
|
4452
|
-
var __getOwnPropDesc$
|
|
4453
|
-
var __decorateClass$
|
|
4454
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4451
|
+
var __defProp$w = Object.defineProperty;
|
|
4452
|
+
var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
|
|
4453
|
+
var __decorateClass$w = (decorators, target, key, kind) => {
|
|
4454
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
|
|
4455
4455
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4456
4456
|
if (decorator = decorators[i])
|
|
4457
4457
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4458
|
-
if (kind && result) __defProp$
|
|
4458
|
+
if (kind && result) __defProp$w(target, key, result);
|
|
4459
4459
|
return result;
|
|
4460
4460
|
};
|
|
4461
4461
|
let Timer = class extends Node {
|
|
@@ -4497,29 +4497,29 @@ let Timer = class extends Node {
|
|
|
4497
4497
|
this.addTime(delta);
|
|
4498
4498
|
}
|
|
4499
4499
|
};
|
|
4500
|
-
__decorateClass$
|
|
4500
|
+
__decorateClass$w([
|
|
4501
4501
|
property({ default: 0 })
|
|
4502
4502
|
], Timer.prototype, "start", 2);
|
|
4503
|
-
__decorateClass$
|
|
4503
|
+
__decorateClass$w([
|
|
4504
4504
|
property({ default: 0 })
|
|
4505
4505
|
], Timer.prototype, "current", 2);
|
|
4506
|
-
__decorateClass$
|
|
4506
|
+
__decorateClass$w([
|
|
4507
4507
|
property({ default: Number.MAX_SAFE_INTEGER })
|
|
4508
4508
|
], Timer.prototype, "end", 2);
|
|
4509
|
-
__decorateClass$
|
|
4509
|
+
__decorateClass$w([
|
|
4510
4510
|
property({ default: false })
|
|
4511
4511
|
], Timer.prototype, "loop", 2);
|
|
4512
|
-
Timer = __decorateClass$
|
|
4512
|
+
Timer = __decorateClass$w([
|
|
4513
4513
|
customNode("Timer")
|
|
4514
4514
|
], Timer);
|
|
4515
4515
|
|
|
4516
|
-
var __defProp$
|
|
4517
|
-
var __decorateClass$
|
|
4516
|
+
var __defProp$v = Object.defineProperty;
|
|
4517
|
+
var __decorateClass$v = (decorators, target, key, kind) => {
|
|
4518
4518
|
var result = void 0 ;
|
|
4519
4519
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4520
4520
|
if (decorator = decorators[i])
|
|
4521
4521
|
result = (decorator(target, key, result) ) || result;
|
|
4522
|
-
if (result) __defProp$
|
|
4522
|
+
if (result) __defProp$v(target, key, result);
|
|
4523
4523
|
return result;
|
|
4524
4524
|
};
|
|
4525
4525
|
class Texture extends Resource {
|
|
@@ -4645,22 +4645,22 @@ class Texture extends Resource {
|
|
|
4645
4645
|
}
|
|
4646
4646
|
}
|
|
4647
4647
|
}
|
|
4648
|
-
__decorateClass$
|
|
4648
|
+
__decorateClass$v([
|
|
4649
4649
|
protectedProperty()
|
|
4650
4650
|
], Texture.prototype, "source");
|
|
4651
|
-
__decorateClass$
|
|
4651
|
+
__decorateClass$v([
|
|
4652
4652
|
protectedProperty({ default: 0 })
|
|
4653
4653
|
], Texture.prototype, "width");
|
|
4654
|
-
__decorateClass$
|
|
4654
|
+
__decorateClass$v([
|
|
4655
4655
|
protectedProperty({ default: 0 })
|
|
4656
4656
|
], Texture.prototype, "height");
|
|
4657
|
-
__decorateClass$
|
|
4657
|
+
__decorateClass$v([
|
|
4658
4658
|
protectedProperty({ default: "linear" })
|
|
4659
4659
|
], Texture.prototype, "filterMode");
|
|
4660
|
-
__decorateClass$
|
|
4660
|
+
__decorateClass$v([
|
|
4661
4661
|
protectedProperty({ default: "clamp_to_edge" })
|
|
4662
4662
|
], Texture.prototype, "wrapMode");
|
|
4663
|
-
__decorateClass$
|
|
4663
|
+
__decorateClass$v([
|
|
4664
4664
|
protectedProperty({ default: 1 })
|
|
4665
4665
|
], Texture.prototype, "pixelRatio");
|
|
4666
4666
|
|
|
@@ -4796,13 +4796,13 @@ class PixelsTexture extends Texture {
|
|
|
4796
4796
|
}
|
|
4797
4797
|
}
|
|
4798
4798
|
|
|
4799
|
-
var __defProp$
|
|
4800
|
-
var __decorateClass$
|
|
4799
|
+
var __defProp$u = Object.defineProperty;
|
|
4800
|
+
var __decorateClass$u = (decorators, target, key, kind) => {
|
|
4801
4801
|
var result = void 0 ;
|
|
4802
4802
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4803
4803
|
if (decorator = decorators[i])
|
|
4804
4804
|
result = (decorator(target, key, result) ) || result;
|
|
4805
|
-
if (result) __defProp$
|
|
4805
|
+
if (result) __defProp$u(target, key, result);
|
|
4806
4806
|
return result;
|
|
4807
4807
|
};
|
|
4808
4808
|
function resolveOptions(options) {
|
|
@@ -5045,10 +5045,10 @@ const _VideoTexture = class _VideoTexture extends Texture {
|
|
|
5045
5045
|
}
|
|
5046
5046
|
}
|
|
5047
5047
|
};
|
|
5048
|
-
__decorateClass$
|
|
5048
|
+
__decorateClass$u([
|
|
5049
5049
|
protectedProperty({ default: true })
|
|
5050
5050
|
], _VideoTexture.prototype, "autoUpdate");
|
|
5051
|
-
__decorateClass$
|
|
5051
|
+
__decorateClass$u([
|
|
5052
5052
|
protectedProperty({ default: 0 })
|
|
5053
5053
|
], _VideoTexture.prototype, "fps");
|
|
5054
5054
|
let VideoTexture = _VideoTexture;
|
|
@@ -5057,14 +5057,14 @@ class ViewportTexture extends PixelsTexture {
|
|
|
5057
5057
|
//
|
|
5058
5058
|
}
|
|
5059
5059
|
|
|
5060
|
-
var __defProp$
|
|
5061
|
-
var __getOwnPropDesc$
|
|
5062
|
-
var __decorateClass$
|
|
5063
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5060
|
+
var __defProp$t = Object.defineProperty;
|
|
5061
|
+
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
5062
|
+
var __decorateClass$t = (decorators, target, key, kind) => {
|
|
5063
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
|
|
5064
5064
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5065
5065
|
if (decorator = decorators[i])
|
|
5066
5066
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5067
|
-
if (kind && result) __defProp$
|
|
5067
|
+
if (kind && result) __defProp$t(target, key, result);
|
|
5068
5068
|
return result;
|
|
5069
5069
|
};
|
|
5070
5070
|
let Viewport = class extends Node {
|
|
@@ -5185,19 +5185,19 @@ let Viewport = class extends Node {
|
|
|
5185
5185
|
return this._projection.toArray(transpose);
|
|
5186
5186
|
}
|
|
5187
5187
|
};
|
|
5188
|
-
__decorateClass$
|
|
5188
|
+
__decorateClass$t([
|
|
5189
5189
|
property({ default: 0 })
|
|
5190
5190
|
], Viewport.prototype, "x", 2);
|
|
5191
|
-
__decorateClass$
|
|
5191
|
+
__decorateClass$t([
|
|
5192
5192
|
property({ default: 0 })
|
|
5193
5193
|
], Viewport.prototype, "y", 2);
|
|
5194
|
-
__decorateClass$
|
|
5194
|
+
__decorateClass$t([
|
|
5195
5195
|
property({ default: 0 })
|
|
5196
5196
|
], Viewport.prototype, "width", 2);
|
|
5197
|
-
__decorateClass$
|
|
5197
|
+
__decorateClass$t([
|
|
5198
5198
|
property({ default: 0 })
|
|
5199
5199
|
], Viewport.prototype, "height", 2);
|
|
5200
|
-
Viewport = __decorateClass$
|
|
5200
|
+
Viewport = __decorateClass$t([
|
|
5201
5201
|
customNode({
|
|
5202
5202
|
tag: "Viewport",
|
|
5203
5203
|
renderable: true
|
|
@@ -5616,13 +5616,13 @@ class ColorTexture extends Texture {
|
|
|
5616
5616
|
}
|
|
5617
5617
|
}
|
|
5618
5618
|
|
|
5619
|
-
var __defProp$
|
|
5620
|
-
var __decorateClass$
|
|
5619
|
+
var __defProp$s = Object.defineProperty;
|
|
5620
|
+
var __decorateClass$s = (decorators, target, key, kind) => {
|
|
5621
5621
|
var result = void 0 ;
|
|
5622
5622
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5623
5623
|
if (decorator = decorators[i])
|
|
5624
5624
|
result = (decorator(target, key, result) ) || result;
|
|
5625
|
-
if (result) __defProp$
|
|
5625
|
+
if (result) __defProp$s(target, key, result);
|
|
5626
5626
|
return result;
|
|
5627
5627
|
};
|
|
5628
5628
|
function proxy$1() {
|
|
@@ -5778,46 +5778,46 @@ class CanvasContext {
|
|
|
5778
5778
|
return batchables;
|
|
5779
5779
|
}
|
|
5780
5780
|
}
|
|
5781
|
-
__decorateClass$
|
|
5781
|
+
__decorateClass$s([
|
|
5782
5782
|
proxy$1()
|
|
5783
5783
|
], CanvasContext.prototype, "moveTo");
|
|
5784
|
-
__decorateClass$
|
|
5784
|
+
__decorateClass$s([
|
|
5785
5785
|
proxy$1()
|
|
5786
5786
|
], CanvasContext.prototype, "lineTo");
|
|
5787
|
-
__decorateClass$
|
|
5787
|
+
__decorateClass$s([
|
|
5788
5788
|
proxy$1()
|
|
5789
5789
|
], CanvasContext.prototype, "bezierCurveTo");
|
|
5790
|
-
__decorateClass$
|
|
5790
|
+
__decorateClass$s([
|
|
5791
5791
|
proxy$1()
|
|
5792
5792
|
], CanvasContext.prototype, "quadraticCurveTo");
|
|
5793
|
-
__decorateClass$
|
|
5793
|
+
__decorateClass$s([
|
|
5794
5794
|
proxy$1()
|
|
5795
5795
|
], CanvasContext.prototype, "ellipticalArc");
|
|
5796
|
-
__decorateClass$
|
|
5796
|
+
__decorateClass$s([
|
|
5797
5797
|
proxy$1()
|
|
5798
5798
|
], CanvasContext.prototype, "rect");
|
|
5799
|
-
__decorateClass$
|
|
5799
|
+
__decorateClass$s([
|
|
5800
5800
|
proxy$1()
|
|
5801
5801
|
], CanvasContext.prototype, "roundRect");
|
|
5802
|
-
__decorateClass$
|
|
5802
|
+
__decorateClass$s([
|
|
5803
5803
|
proxy$1()
|
|
5804
5804
|
], CanvasContext.prototype, "ellipse");
|
|
5805
|
-
__decorateClass$
|
|
5805
|
+
__decorateClass$s([
|
|
5806
5806
|
proxy$1()
|
|
5807
5807
|
], CanvasContext.prototype, "arc");
|
|
5808
|
-
__decorateClass$
|
|
5808
|
+
__decorateClass$s([
|
|
5809
5809
|
proxy$1()
|
|
5810
5810
|
], CanvasContext.prototype, "poly");
|
|
5811
|
-
__decorateClass$
|
|
5811
|
+
__decorateClass$s([
|
|
5812
5812
|
proxy$1()
|
|
5813
5813
|
], CanvasContext.prototype, "addShape");
|
|
5814
|
-
__decorateClass$
|
|
5814
|
+
__decorateClass$s([
|
|
5815
5815
|
proxy$1()
|
|
5816
5816
|
], CanvasContext.prototype, "addPath");
|
|
5817
|
-
__decorateClass$
|
|
5817
|
+
__decorateClass$s([
|
|
5818
5818
|
proxy$1()
|
|
5819
5819
|
], CanvasContext.prototype, "addSvgPath");
|
|
5820
|
-
__decorateClass$
|
|
5820
|
+
__decorateClass$s([
|
|
5821
5821
|
proxy$1()
|
|
5822
5822
|
], CanvasContext.prototype, "closePath");
|
|
5823
5823
|
|
|
@@ -6185,16 +6185,13 @@ class Style2DBackgroundModule extends Style2DModule {
|
|
|
6185
6185
|
install(Style2D) {
|
|
6186
6186
|
defineProperty(Style2D, "backgroundColor");
|
|
6187
6187
|
defineProperty(Style2D, "backgroundImage");
|
|
6188
|
-
Style2D.prototype.
|
|
6188
|
+
Style2D.prototype.getComputedBackgroundImage = getComputedBackgroundImage;
|
|
6189
6189
|
}
|
|
6190
6190
|
}
|
|
6191
|
-
async function
|
|
6191
|
+
async function getComputedBackgroundImage() {
|
|
6192
6192
|
if (this.backgroundImage) {
|
|
6193
6193
|
return await assets.texture.load(this.backgroundImage);
|
|
6194
6194
|
}
|
|
6195
|
-
if (this.backgroundColor) {
|
|
6196
|
-
return new ColorTexture(this.backgroundColor);
|
|
6197
|
-
}
|
|
6198
6195
|
}
|
|
6199
6196
|
|
|
6200
6197
|
class Style2DFilterModule extends Style2DModule {
|
|
@@ -6442,13 +6439,13 @@ const modules = {
|
|
|
6442
6439
|
Style2DTransformModule: Style2DTransformModule
|
|
6443
6440
|
};
|
|
6444
6441
|
|
|
6445
|
-
var __defProp$
|
|
6446
|
-
var __decorateClass$
|
|
6442
|
+
var __defProp$r = Object.defineProperty;
|
|
6443
|
+
var __decorateClass$r = (decorators, target, key, kind) => {
|
|
6447
6444
|
var result = void 0 ;
|
|
6448
6445
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6449
6446
|
if (decorator = decorators[i])
|
|
6450
6447
|
result = (decorator(target, key, result) ) || result;
|
|
6451
|
-
if (result) __defProp$
|
|
6448
|
+
if (result) __defProp$r(target, key, result);
|
|
6452
6449
|
return result;
|
|
6453
6450
|
};
|
|
6454
6451
|
class Style2D extends _Object {
|
|
@@ -6474,39 +6471,39 @@ class Style2D extends _Object {
|
|
|
6474
6471
|
}
|
|
6475
6472
|
}
|
|
6476
6473
|
}
|
|
6477
|
-
__decorateClass$
|
|
6474
|
+
__decorateClass$r([
|
|
6478
6475
|
property({ default: "#000000" })
|
|
6479
6476
|
], Style2D.prototype, "shadowColor");
|
|
6480
|
-
__decorateClass$
|
|
6477
|
+
__decorateClass$r([
|
|
6481
6478
|
property({ default: 0 })
|
|
6482
6479
|
], Style2D.prototype, "shadowOffsetX");
|
|
6483
|
-
__decorateClass$
|
|
6480
|
+
__decorateClass$r([
|
|
6484
6481
|
property({ default: 0 })
|
|
6485
6482
|
], Style2D.prototype, "shadowOffsetY");
|
|
6486
|
-
__decorateClass$
|
|
6483
|
+
__decorateClass$r([
|
|
6487
6484
|
property({ default: 0 })
|
|
6488
6485
|
], Style2D.prototype, "shadowBlur");
|
|
6489
|
-
__decorateClass$
|
|
6486
|
+
__decorateClass$r([
|
|
6490
6487
|
property({ default: 1 })
|
|
6491
6488
|
], Style2D.prototype, "opacity");
|
|
6492
|
-
__decorateClass$
|
|
6489
|
+
__decorateClass$r([
|
|
6493
6490
|
property({ default: 0 })
|
|
6494
6491
|
], Style2D.prototype, "borderRadius");
|
|
6495
|
-
__decorateClass$
|
|
6492
|
+
__decorateClass$r([
|
|
6496
6493
|
property({ default: "visible" })
|
|
6497
6494
|
], Style2D.prototype, "overflow");
|
|
6498
6495
|
Object.values(modules).forEach((Module) => {
|
|
6499
6496
|
new Module().install(Style2D);
|
|
6500
6497
|
});
|
|
6501
6498
|
|
|
6502
|
-
var __defProp$
|
|
6503
|
-
var __getOwnPropDesc$
|
|
6504
|
-
var __decorateClass$
|
|
6505
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6499
|
+
var __defProp$q = Object.defineProperty;
|
|
6500
|
+
var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
|
|
6501
|
+
var __decorateClass$q = (decorators, target, key, kind) => {
|
|
6502
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
|
|
6506
6503
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6507
6504
|
if (decorator = decorators[i])
|
|
6508
6505
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6509
|
-
if (kind && result) __defProp$
|
|
6506
|
+
if (kind && result) __defProp$q(target, key, result);
|
|
6510
6507
|
return result;
|
|
6511
6508
|
};
|
|
6512
6509
|
let CanvasItem = class extends Node {
|
|
@@ -6525,12 +6522,13 @@ let CanvasItem = class extends Node {
|
|
|
6525
6522
|
_parentOpacity;
|
|
6526
6523
|
_tint = new Color(4294967295);
|
|
6527
6524
|
_backgroundColor = new Color(0);
|
|
6528
|
-
|
|
6525
|
+
_backgroundImage;
|
|
6526
|
+
// Batch render
|
|
6529
6527
|
context = new CanvasContext();
|
|
6530
6528
|
_resetContext = true;
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6529
|
+
_redrawing = false;
|
|
6530
|
+
_reflowing = false;
|
|
6531
|
+
_repainting = false;
|
|
6534
6532
|
_originalBatchables = [];
|
|
6535
6533
|
_layoutedBatchables = [];
|
|
6536
6534
|
_batchables = [];
|
|
@@ -6564,12 +6562,10 @@ let CanvasItem = class extends Node {
|
|
|
6564
6562
|
_onUpdateStyleProperty(key, newValue, oldValue, declaration) {
|
|
6565
6563
|
switch (key) {
|
|
6566
6564
|
case "backgroundColor":
|
|
6567
|
-
this.
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
this.requestRedraw();
|
|
6572
|
-
}
|
|
6565
|
+
this._updateBackgroundColor();
|
|
6566
|
+
break;
|
|
6567
|
+
case "backgroundImage":
|
|
6568
|
+
this._updateBackgroundImage();
|
|
6573
6569
|
break;
|
|
6574
6570
|
case "opacity":
|
|
6575
6571
|
this._updateOpacity();
|
|
@@ -6577,8 +6573,23 @@ let CanvasItem = class extends Node {
|
|
|
6577
6573
|
case "filter":
|
|
6578
6574
|
this.requestRepaint();
|
|
6579
6575
|
break;
|
|
6576
|
+
case "borderRadius":
|
|
6577
|
+
this.requestRedraw();
|
|
6578
|
+
break;
|
|
6579
|
+
}
|
|
6580
|
+
}
|
|
6581
|
+
_updateBackgroundColor() {
|
|
6582
|
+
this._backgroundColor.value = this.style.backgroundColor || 0;
|
|
6583
|
+
if (this._originalBatchables.length) {
|
|
6584
|
+
this.requestRepaint();
|
|
6585
|
+
} else if (this._backgroundColor.a > 0) {
|
|
6586
|
+
this.requestRedraw();
|
|
6580
6587
|
}
|
|
6581
6588
|
}
|
|
6589
|
+
async _updateBackgroundImage() {
|
|
6590
|
+
this._backgroundImage = await this.style.getComputedBackgroundImage();
|
|
6591
|
+
this.requestRedraw();
|
|
6592
|
+
}
|
|
6582
6593
|
_updateOpacity() {
|
|
6583
6594
|
const opacity = clamp(0, this.style.opacity, 1) * (this._parent?.opacity ?? 1);
|
|
6584
6595
|
if (this.opacity !== opacity) {
|
|
@@ -6590,13 +6601,13 @@ let CanvasItem = class extends Node {
|
|
|
6590
6601
|
return this.opacity > 0 && super.isVisible();
|
|
6591
6602
|
}
|
|
6592
6603
|
requestRedraw() {
|
|
6593
|
-
this.
|
|
6604
|
+
this._redrawing = true;
|
|
6594
6605
|
}
|
|
6595
6606
|
requestReflow() {
|
|
6596
|
-
this.
|
|
6607
|
+
this._reflowing = true;
|
|
6597
6608
|
}
|
|
6598
6609
|
requestRepaint() {
|
|
6599
|
-
this.
|
|
6610
|
+
this._repainting = true;
|
|
6600
6611
|
}
|
|
6601
6612
|
_process(delta) {
|
|
6602
6613
|
const parentOpacity = this._parent?.opacity;
|
|
@@ -6607,6 +6618,30 @@ let CanvasItem = class extends Node {
|
|
|
6607
6618
|
super._process(delta);
|
|
6608
6619
|
}
|
|
6609
6620
|
_draw() {
|
|
6621
|
+
this._drawBackground();
|
|
6622
|
+
this._drawContent();
|
|
6623
|
+
}
|
|
6624
|
+
_drawBackground() {
|
|
6625
|
+
const texture = this._backgroundImage;
|
|
6626
|
+
if (texture?.valid) {
|
|
6627
|
+
this.context.fillStyle = texture;
|
|
6628
|
+
this.context.textureTransform = new Transform2D().scale(
|
|
6629
|
+
this.style.width / texture.width,
|
|
6630
|
+
this.style.height / texture.height
|
|
6631
|
+
);
|
|
6632
|
+
this._fill();
|
|
6633
|
+
}
|
|
6634
|
+
}
|
|
6635
|
+
_drawContent() {
|
|
6636
|
+
this._fill();
|
|
6637
|
+
}
|
|
6638
|
+
_fill() {
|
|
6639
|
+
if (this.style.borderRadius) {
|
|
6640
|
+
this.context.roundRect(0, 0, this.style.width, this.style.height, this.style.borderRadius);
|
|
6641
|
+
} else {
|
|
6642
|
+
this.context.rect(0, 0, this.style.width, this.style.height);
|
|
6643
|
+
}
|
|
6644
|
+
this.context.fill();
|
|
6610
6645
|
}
|
|
6611
6646
|
_relayout(batchables) {
|
|
6612
6647
|
return this._reflow(batchables);
|
|
@@ -6629,7 +6664,7 @@ let CanvasItem = class extends Node {
|
|
|
6629
6664
|
}
|
|
6630
6665
|
_render(renderer) {
|
|
6631
6666
|
let batchables;
|
|
6632
|
-
if (this.
|
|
6667
|
+
if (this._redrawing) {
|
|
6633
6668
|
this._draw();
|
|
6634
6669
|
this._originalBatchables = this.context.toBatchables();
|
|
6635
6670
|
this._layoutedBatchables = this._relayout(this._originalBatchables);
|
|
@@ -6637,17 +6672,17 @@ let CanvasItem = class extends Node {
|
|
|
6637
6672
|
if (this._resetContext) {
|
|
6638
6673
|
this.context.reset();
|
|
6639
6674
|
}
|
|
6640
|
-
} else if (this.
|
|
6675
|
+
} else if (this._reflowing) {
|
|
6641
6676
|
this._layoutedBatchables = this._reflow(this._originalBatchables);
|
|
6642
6677
|
batchables = this._layoutedBatchables;
|
|
6643
|
-
} else if (this.
|
|
6678
|
+
} else if (this._repainting) {
|
|
6644
6679
|
batchables = this._repaint(this._layoutedBatchables);
|
|
6645
6680
|
}
|
|
6646
6681
|
if (batchables) {
|
|
6647
6682
|
this._batchables = batchables;
|
|
6648
|
-
this.
|
|
6649
|
-
this.
|
|
6650
|
-
this.
|
|
6683
|
+
this._redrawing = false;
|
|
6684
|
+
this._reflowing = false;
|
|
6685
|
+
this._repainting = false;
|
|
6651
6686
|
}
|
|
6652
6687
|
this._batchables.forEach((batchable) => {
|
|
6653
6688
|
batchable.texture?.upload(renderer);
|
|
@@ -6669,24 +6704,24 @@ let CanvasItem = class extends Node {
|
|
|
6669
6704
|
};
|
|
6670
6705
|
}
|
|
6671
6706
|
};
|
|
6672
|
-
__decorateClass$
|
|
6707
|
+
__decorateClass$q([
|
|
6673
6708
|
property()
|
|
6674
6709
|
], CanvasItem.prototype, "tint", 2);
|
|
6675
|
-
__decorateClass$
|
|
6710
|
+
__decorateClass$q([
|
|
6676
6711
|
property()
|
|
6677
6712
|
], CanvasItem.prototype, "blendMode", 2);
|
|
6678
|
-
CanvasItem = __decorateClass$
|
|
6713
|
+
CanvasItem = __decorateClass$q([
|
|
6679
6714
|
customNode("CanvasItem")
|
|
6680
6715
|
], CanvasItem);
|
|
6681
6716
|
|
|
6682
|
-
var __defProp$
|
|
6683
|
-
var __getOwnPropDesc$
|
|
6684
|
-
var __decorateClass$
|
|
6685
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6717
|
+
var __defProp$p = Object.defineProperty;
|
|
6718
|
+
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
6719
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
6720
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
|
|
6686
6721
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6687
6722
|
if (decorator = decorators[i])
|
|
6688
6723
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6689
|
-
if (kind && result) __defProp$
|
|
6724
|
+
if (kind && result) __defProp$p(target, key, result);
|
|
6690
6725
|
return result;
|
|
6691
6726
|
};
|
|
6692
6727
|
const linear = (amount) => amount;
|
|
@@ -6753,8 +6788,8 @@ let Animation2D = class extends Node {
|
|
|
6753
6788
|
_startProps = /* @__PURE__ */ new WeakMap();
|
|
6754
6789
|
constructor(options) {
|
|
6755
6790
|
super();
|
|
6756
|
-
this.setProperties(options);
|
|
6757
6791
|
this._onUpdateTime = this._onUpdateTime.bind(this);
|
|
6792
|
+
this.setProperties(options);
|
|
6758
6793
|
}
|
|
6759
6794
|
_enterTree() {
|
|
6760
6795
|
this._tree?.timeline.on("update", this._onUpdateTime);
|
|
@@ -6973,36 +7008,36 @@ let Animation2D = class extends Node {
|
|
|
6973
7008
|
});
|
|
6974
7009
|
}
|
|
6975
7010
|
};
|
|
6976
|
-
__decorateClass$
|
|
7011
|
+
__decorateClass$p([
|
|
6977
7012
|
property({ default: "parent" })
|
|
6978
7013
|
], Animation2D.prototype, "mode", 2);
|
|
6979
|
-
__decorateClass$
|
|
7014
|
+
__decorateClass$p([
|
|
6980
7015
|
property({ default: false })
|
|
6981
7016
|
], Animation2D.prototype, "loop", 2);
|
|
6982
|
-
__decorateClass$
|
|
7017
|
+
__decorateClass$p([
|
|
6983
7018
|
property({ default: [] })
|
|
6984
7019
|
], Animation2D.prototype, "keyframes", 2);
|
|
6985
|
-
__decorateClass$
|
|
7020
|
+
__decorateClass$p([
|
|
6986
7021
|
property()
|
|
6987
7022
|
], Animation2D.prototype, "easing", 2);
|
|
6988
|
-
__decorateClass$
|
|
7023
|
+
__decorateClass$p([
|
|
6989
7024
|
property({ alias: "visibleDelay", default: 0 })
|
|
6990
7025
|
], Animation2D.prototype, "delay", 2);
|
|
6991
|
-
__decorateClass$
|
|
7026
|
+
__decorateClass$p([
|
|
6992
7027
|
property({ alias: "visibleDuration", default: 2e3 })
|
|
6993
7028
|
], Animation2D.prototype, "duration", 2);
|
|
6994
|
-
Animation2D = __decorateClass$
|
|
7029
|
+
Animation2D = __decorateClass$p([
|
|
6995
7030
|
customNode("Animation2D")
|
|
6996
7031
|
], Animation2D);
|
|
6997
7032
|
|
|
6998
|
-
var __defProp$
|
|
6999
|
-
var __getOwnPropDesc$
|
|
7000
|
-
var __decorateClass$
|
|
7001
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7033
|
+
var __defProp$o = Object.defineProperty;
|
|
7034
|
+
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
7035
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
7036
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
7002
7037
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7003
7038
|
if (decorator = decorators[i])
|
|
7004
7039
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7005
|
-
if (kind && result) __defProp$
|
|
7040
|
+
if (kind && result) __defProp$o(target, key, result);
|
|
7006
7041
|
return result;
|
|
7007
7042
|
};
|
|
7008
7043
|
let Node2D = class extends CanvasItem {
|
|
@@ -7048,6 +7083,9 @@ let Node2D = class extends CanvasItem {
|
|
|
7048
7083
|
case "transformOrigin":
|
|
7049
7084
|
this._updateTransform();
|
|
7050
7085
|
break;
|
|
7086
|
+
case "overflow":
|
|
7087
|
+
this._updateOverflow();
|
|
7088
|
+
break;
|
|
7051
7089
|
}
|
|
7052
7090
|
}
|
|
7053
7091
|
_updateTransform() {
|
|
@@ -7073,8 +7111,24 @@ let Node2D = class extends CanvasItem {
|
|
|
7073
7111
|
transform = t3dT2d;
|
|
7074
7112
|
}
|
|
7075
7113
|
this._transform.set(transform);
|
|
7114
|
+
this._updateOverflow();
|
|
7076
7115
|
this.requestReflow();
|
|
7077
7116
|
}
|
|
7117
|
+
_updateOverflow() {
|
|
7118
|
+
if (this.style.overflow === "hidden") {
|
|
7119
|
+
const [a, c, tx, b, d, ty] = this._transform.toArray();
|
|
7120
|
+
const width = this.style.width;
|
|
7121
|
+
const height = this.style.height;
|
|
7122
|
+
this.mask = {
|
|
7123
|
+
x: tx,
|
|
7124
|
+
y: ty,
|
|
7125
|
+
width: a * width + c * height,
|
|
7126
|
+
height: b * width + d * height
|
|
7127
|
+
};
|
|
7128
|
+
} else {
|
|
7129
|
+
this.mask = void 0;
|
|
7130
|
+
}
|
|
7131
|
+
}
|
|
7078
7132
|
_transformVertices(vertices) {
|
|
7079
7133
|
const [a, c, tx, b, d, ty] = this._transform.toArray();
|
|
7080
7134
|
const newVertices = vertices.slice();
|
|
@@ -7117,101 +7171,12 @@ let Node2D = class extends CanvasItem {
|
|
|
7117
7171
|
}
|
|
7118
7172
|
}
|
|
7119
7173
|
};
|
|
7120
|
-
Node2D = __decorateClass$
|
|
7121
|
-
customNode("Node2D")
|
|
7122
|
-
], Node2D);
|
|
7123
|
-
|
|
7124
|
-
var __defProp$o = Object.defineProperty;
|
|
7125
|
-
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
7126
|
-
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
7127
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
7128
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7129
|
-
if (decorator = decorators[i])
|
|
7130
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7131
|
-
if (kind && result) __defProp$o(target, key, result);
|
|
7132
|
-
return result;
|
|
7133
|
-
};
|
|
7134
|
-
let Element2D = class extends Node2D {
|
|
7135
|
-
draggable;
|
|
7136
|
-
_background;
|
|
7137
|
-
constructor(options) {
|
|
7138
|
-
super();
|
|
7139
|
-
this.setProperties(options);
|
|
7140
|
-
}
|
|
7141
|
-
_onUpdateStyleProperty(key, value, oldValue) {
|
|
7142
|
-
super._onUpdateStyleProperty(key, value, oldValue);
|
|
7143
|
-
switch (key) {
|
|
7144
|
-
case "backgroundImage":
|
|
7145
|
-
this._updateBackground();
|
|
7146
|
-
break;
|
|
7147
|
-
case "borderRadius":
|
|
7148
|
-
this.requestRedraw();
|
|
7149
|
-
break;
|
|
7150
|
-
case "overflow":
|
|
7151
|
-
this._updateOverflow();
|
|
7152
|
-
break;
|
|
7153
|
-
}
|
|
7154
|
-
}
|
|
7155
|
-
async _updateBackground() {
|
|
7156
|
-
this._background = await this.style.getComputedBackground();
|
|
7157
|
-
this.requestRedraw();
|
|
7158
|
-
}
|
|
7159
|
-
_updateTransform() {
|
|
7160
|
-
super._updateTransform();
|
|
7161
|
-
this._updateOverflow();
|
|
7162
|
-
}
|
|
7163
|
-
_updateOverflow() {
|
|
7164
|
-
if (this.style.overflow === "hidden") {
|
|
7165
|
-
const [a, c, tx, b, d, ty] = this._transform.toArray();
|
|
7166
|
-
const width = this.style.width;
|
|
7167
|
-
const height = this.style.height;
|
|
7168
|
-
this.mask = {
|
|
7169
|
-
x: tx,
|
|
7170
|
-
y: ty,
|
|
7171
|
-
width: a * width + c * height,
|
|
7172
|
-
height: b * width + d * height
|
|
7173
|
-
};
|
|
7174
|
-
} else {
|
|
7175
|
-
this.mask = void 0;
|
|
7176
|
-
}
|
|
7177
|
-
}
|
|
7178
|
-
_draw() {
|
|
7179
|
-
super._draw();
|
|
7180
|
-
this._drawBackground();
|
|
7181
|
-
this._drawContent();
|
|
7182
|
-
}
|
|
7183
|
-
_drawBackground() {
|
|
7184
|
-
const texture = this._background;
|
|
7185
|
-
if (!texture?.valid)
|
|
7186
|
-
return;
|
|
7187
|
-
this.context.fillStyle = texture;
|
|
7188
|
-
this.context.textureTransform = new Transform2D().scale(
|
|
7189
|
-
this.style.width / texture.width,
|
|
7190
|
-
this.style.height / texture.height
|
|
7191
|
-
);
|
|
7192
|
-
this._drawRect();
|
|
7193
|
-
}
|
|
7194
|
-
_drawContent() {
|
|
7195
|
-
this._drawRect();
|
|
7196
|
-
}
|
|
7197
|
-
_drawRect() {
|
|
7198
|
-
if (this.style.borderRadius) {
|
|
7199
|
-
this.context.roundRect(0, 0, this.style.width, this.style.height, this.style.borderRadius);
|
|
7200
|
-
} else {
|
|
7201
|
-
this.context.rect(0, 0, this.style.width, this.style.height);
|
|
7202
|
-
}
|
|
7203
|
-
this.context.fill();
|
|
7204
|
-
}
|
|
7205
|
-
};
|
|
7206
|
-
__decorateClass$o([
|
|
7207
|
-
property()
|
|
7208
|
-
], Element2D.prototype, "draggable", 2);
|
|
7209
|
-
Element2D = __decorateClass$o([
|
|
7174
|
+
Node2D = __decorateClass$o([
|
|
7210
7175
|
customNode({
|
|
7211
|
-
tag: "
|
|
7176
|
+
tag: "Node2D",
|
|
7212
7177
|
renderable: true
|
|
7213
7178
|
})
|
|
7214
|
-
],
|
|
7179
|
+
], Node2D);
|
|
7215
7180
|
|
|
7216
7181
|
var __defProp$n = Object.defineProperty;
|
|
7217
7182
|
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
@@ -7320,10 +7285,7 @@ __decorateClass$n([
|
|
|
7320
7285
|
proxy({ method: true, redraw: true })
|
|
7321
7286
|
], Graphics2D.prototype, "stroke", 2);
|
|
7322
7287
|
Graphics2D = __decorateClass$n([
|
|
7323
|
-
customNode(
|
|
7324
|
-
tag: "Graphics2D",
|
|
7325
|
-
renderable: true
|
|
7326
|
-
})
|
|
7288
|
+
customNode("Graphics2D")
|
|
7327
7289
|
], Graphics2D);
|
|
7328
7290
|
|
|
7329
7291
|
class Image2DResource extends Resource {
|
|
@@ -7362,7 +7324,7 @@ var __decorateClass$m = (decorators, target, key, kind) => {
|
|
|
7362
7324
|
if (kind && result) __defProp$m(target, key, result);
|
|
7363
7325
|
return result;
|
|
7364
7326
|
};
|
|
7365
|
-
let Image2D = class extends
|
|
7327
|
+
let Image2D = class extends Node2D {
|
|
7366
7328
|
resource;
|
|
7367
7329
|
get currentTexture() {
|
|
7368
7330
|
return this.resource?.frames[this._frameIndex]?.texture;
|
|
@@ -7481,7 +7443,7 @@ let Image2D = class extends Element2D {
|
|
|
7481
7443
|
const texture = this.currentTexture;
|
|
7482
7444
|
return super._repaint(
|
|
7483
7445
|
batchables.map((batchable, i) => {
|
|
7484
|
-
if ((this.
|
|
7446
|
+
if ((this._backgroundImage ? i === 1 : i === 0) && batchable.type === "fill") {
|
|
7485
7447
|
return {
|
|
7486
7448
|
...batchable,
|
|
7487
7449
|
texture: texture?.valid ? texture : void 0
|
|
@@ -7515,7 +7477,7 @@ var __decorateClass$l = (decorators, target, key, kind) => {
|
|
|
7515
7477
|
if (kind && result) __defProp$l(target, key, result);
|
|
7516
7478
|
return result;
|
|
7517
7479
|
};
|
|
7518
|
-
let Lottie2D = class extends
|
|
7480
|
+
let Lottie2D = class extends Node2D {
|
|
7519
7481
|
duration = 0;
|
|
7520
7482
|
texture = new Texture(document.createElement("canvas"));
|
|
7521
7483
|
animation;
|
|
@@ -7587,7 +7549,7 @@ var __decorateClass$k = (decorators, target, key, kind) => {
|
|
|
7587
7549
|
return result;
|
|
7588
7550
|
};
|
|
7589
7551
|
const textStyles = new Set(Object.keys(textDefaultStyle));
|
|
7590
|
-
let Text2D = class extends
|
|
7552
|
+
let Text2D = class extends Node2D {
|
|
7591
7553
|
effects;
|
|
7592
7554
|
texture = new Texture(document.createElement("canvas"));
|
|
7593
7555
|
_subTextsCount = 0;
|
|
@@ -7747,7 +7709,7 @@ var __decorateClass$j = (decorators, target, key, kind) => {
|
|
|
7747
7709
|
if (kind && result) __defProp$j(target, key, result);
|
|
7748
7710
|
return result;
|
|
7749
7711
|
};
|
|
7750
|
-
let Video2D = class extends
|
|
7712
|
+
let Video2D = class extends Node2D {
|
|
7751
7713
|
texture;
|
|
7752
7714
|
get duration() {
|
|
7753
7715
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
@@ -8913,7 +8875,7 @@ Audio = __decorateClass$i([
|
|
|
8913
8875
|
customNode("Audio")
|
|
8914
8876
|
], Audio);
|
|
8915
8877
|
|
|
8916
|
-
class AudioSpectrum extends
|
|
8878
|
+
class AudioSpectrum extends Node2D {
|
|
8917
8879
|
//
|
|
8918
8880
|
}
|
|
8919
8881
|
|
|
@@ -8927,7 +8889,7 @@ var __decorateClass$h = (decorators, target, key, kind) => {
|
|
|
8927
8889
|
if (kind && result) __defProp$h(target, key, result);
|
|
8928
8890
|
return result;
|
|
8929
8891
|
};
|
|
8930
|
-
let AudioWaveform = class extends
|
|
8892
|
+
let AudioWaveform = class extends Node2D {
|
|
8931
8893
|
src;
|
|
8932
8894
|
gap = 0;
|
|
8933
8895
|
color = "#000000";
|
|
@@ -13891,4 +13853,4 @@ async function render(options) {
|
|
|
13891
13853
|
});
|
|
13892
13854
|
}
|
|
13893
13855
|
|
|
13894
|
-
export { Animation2D, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BlurEffect, Bounds, CanvasContext, CanvasItem, Circle, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, DEG_TO_RAD, DEVICE_PIXEL_RATIO, Effect, EffectMaterial,
|
|
13856
|
+
export { Animation2D, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BlurEffect, Bounds, CanvasContext, CanvasItem, Circle, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, DEG_TO_RAD, DEVICE_PIXEL_RATIO, Effect, EffectMaterial, Ellipse, EmbossEffect, Engine, EventEmitter, FontLoader, Geometry, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, Image2DResource, ImageTexture, IndexBuffer, Input, InternalMode, JsonLoader, KawaseEffect, LeftEraseEffect, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, PI, PI_2, Path2D, PixelateEffect, PixelsTexture, Point, PointerInputEvent, Polygon, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Rectangle, Reference, RenderStack, Renderer, Resource, RoundedRectangle, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, SVGPath, SceneTree, Star, Style2D, Style2DBackgroundModule, Style2DFilterModule, Style2DModule, Style2DOffsetModule, Style2DTextModule, Style2DTransformModule, Text2D, TextLoader, Texture, TextureLoader, Ticker, TiltShiftEffect, Timer, Transform2D, Triangle, TwistEffect, UIInputEvent, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, ZoomBlurEffect, _Object, assets, buildAdaptiveBezier, buildAdaptiveQuadratic, buildArc, buildArcTo, buildArcToSvg, buildCircle, buildLine, buildPolygon, buildRectangle, buildTriangle, clamp, closePointEps, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curveEps, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, squaredDistanceToLineSegment, timingFunctions, uid };
|