@safe-engine/pixi 8.4.6 → 8.5.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.
Files changed (98) hide show
  1. package/README.md +14 -23
  2. package/dist/box2d-wasm/ContactListener.d.ts +1 -1
  3. package/dist/box2d-wasm/ContactListener.d.ts.map +1 -1
  4. package/dist/box2d-wasm/ContactListener.js +50 -18
  5. package/dist/box2d-wasm/PhysicsComponent.d.ts +27 -30
  6. package/dist/box2d-wasm/PhysicsComponent.d.ts.map +1 -1
  7. package/dist/box2d-wasm/PhysicsComponent.js +44 -11
  8. package/dist/box2d-wasm/PhysicsSprite.d.ts +3 -0
  9. package/dist/box2d-wasm/PhysicsSprite.d.ts.map +1 -1
  10. package/dist/box2d-wasm/PhysicsSprite.js +24 -3
  11. package/dist/box2d-wasm/PhysicsSystem.d.ts +4 -2
  12. package/dist/box2d-wasm/PhysicsSystem.d.ts.map +1 -1
  13. package/dist/box2d-wasm/PhysicsSystem.js +134 -44
  14. package/dist/collider/CollideComponent.d.ts +27 -10
  15. package/dist/collider/CollideComponent.d.ts.map +1 -1
  16. package/dist/collider/CollideComponent.js +10 -12
  17. package/dist/collider/helper/Intersection.d.ts +6 -6
  18. package/dist/collider/helper/Intersection.d.ts.map +1 -1
  19. package/dist/collider/helper/Intersection.js +4 -4
  20. package/dist/components/NodeComp.js +1 -1
  21. package/dist/helper/utils.d.ts +0 -6
  22. package/dist/helper/utils.d.ts.map +1 -1
  23. package/dist/helper/utils.js +0 -12
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -0
  27. package/{src/spine/lib/require-shim.ts → dist/spine/lib/assets/atlasLoader.d.ts} +5 -14
  28. package/dist/spine/lib/assets/atlasLoader.d.ts.map +1 -0
  29. package/dist/spine/lib/assets/atlasLoader.js +122 -0
  30. package/{src/spine/lib/darktint/DarkTintShader.ts → dist/spine/lib/assets/skeletonLoader.d.ts} +3 -47
  31. package/dist/spine/lib/assets/skeletonLoader.d.ts.map +1 -0
  32. package/dist/spine/lib/assets/skeletonLoader.js +70 -0
  33. package/package.json +6 -2
  34. package/.github/workflows/npm-publish.yml +0 -35
  35. package/dist/@types/safex.d.ts +0 -15
  36. package/src/@types/index.d.ts +0 -2
  37. package/src/app.ts +0 -91
  38. package/src/base/EnhancedComponent.ts +0 -38
  39. package/src/base/gworld.ts +0 -20
  40. package/src/base/index.ts +0 -14
  41. package/src/base/utils.ts +0 -23
  42. package/src/box2d-wasm/ContactListener.ts +0 -66
  43. package/src/box2d-wasm/PhysicsComponent.ts +0 -83
  44. package/src/box2d-wasm/PhysicsSprite.ts +0 -42
  45. package/src/box2d-wasm/PhysicsSystem.ts +0 -142
  46. package/src/box2d-wasm/debugDraw.ts +0 -249
  47. package/src/box2d-wasm/index.ts +0 -19
  48. package/src/collider/CollideComponent.ts +0 -257
  49. package/src/collider/CollideSystem.ts +0 -166
  50. package/src/collider/helper/Intersection.ts +0 -139
  51. package/src/collider/helper/utils.ts +0 -37
  52. package/src/collider/index.ts +0 -16
  53. package/src/components/BaseComponent.ts +0 -17
  54. package/src/components/NodeComp.ts +0 -442
  55. package/src/components/Scene.ts +0 -17
  56. package/src/core/Color.ts +0 -7
  57. package/src/core/LoadingBar.ts +0 -63
  58. package/src/core/NodePool.ts +0 -28
  59. package/src/core/Size.ts +0 -21
  60. package/src/core/Vec2.ts +0 -108
  61. package/src/core/director.ts +0 -11
  62. package/src/core/index.ts +0 -7
  63. package/src/core/loader.ts +0 -14
  64. package/src/core/math.ts +0 -22
  65. package/src/dragonbones/DragonBonesComponent.ts +0 -32
  66. package/src/dragonbones/DragonBonesSystem.ts +0 -35
  67. package/src/dragonbones/index.ts +0 -11
  68. package/src/gui/GUIComponent.ts +0 -155
  69. package/src/gui/GUISystem.ts +0 -125
  70. package/src/helper/utils.ts +0 -50
  71. package/src/index.ts +0 -19
  72. package/src/norender/NoRenderComponent.ts +0 -60
  73. package/src/norender/NoRenderSystem.ts +0 -67
  74. package/src/norender/Touch.ts +0 -37
  75. package/src/planck/PhysicsComponent.ts +0 -83
  76. package/src/planck/PhysicsSprite.ts +0 -43
  77. package/src/planck/PhysicsSystem.ts +0 -201
  78. package/src/planck/index.ts +0 -3
  79. package/src/render/RenderComponent.ts +0 -132
  80. package/src/render/RenderSystem.ts +0 -64
  81. package/src/richtext/RichTextComp.ts +0 -50
  82. package/src/richtext/RichTextSystem.ts +0 -26
  83. package/src/richtext/html-text-parser.ts +0 -87
  84. package/src/richtext/index.ts +0 -8
  85. package/src/spine/SpineComponent.ts +0 -18
  86. package/src/spine/SpineSystem.ts +0 -30
  87. package/src/spine/index.ts +0 -11
  88. package/src/spine/lib/BatchableSpineSlot.ts +0 -138
  89. package/src/spine/lib/Spine.ts +0 -894
  90. package/src/spine/lib/SpineDebugRenderer.ts +0 -615
  91. package/src/spine/lib/SpinePipe.ts +0 -203
  92. package/src/spine/lib/SpineTexture.ts +0 -143
  93. package/src/spine/lib/darktint/DarkTintBatchGeometry.ts +0 -92
  94. package/src/spine/lib/darktint/DarkTintBatcher.ts +0 -186
  95. package/src/spine/lib/darktint/darkTintBit.ts +0 -77
  96. package/src/spine/lib/index.ts +0 -43
  97. package/tsconfig.json +0 -18
  98. /package/{dist/@types → @types}/index.d.ts +0 -0
@@ -1,8 +0,0 @@
1
- import { GameWorld } from '..'
2
- import { RichTextSystem } from './RichTextSystem'
3
- export * from './RichTextComp'
4
-
5
- export function setupRichText() {
6
- GameWorld.Instance.systems.add(RichTextSystem)
7
- GameWorld.Instance.systems.configureOnce(RichTextSystem)
8
- }
@@ -1,18 +0,0 @@
1
- import { BaseComponentProps } from '..'
2
- import { ComponentX } from '../components/BaseComponent'
3
- import { Spine } from './lib'
4
-
5
- interface SpineData {
6
- atlas: string
7
- skeleton: string
8
- texture?: string
9
- }
10
-
11
- interface SpineSkeletonProps extends BaseComponentProps<SpineSkeleton> {
12
- data: SpineData
13
- skin?: string
14
- animation?: string
15
- timeScale?: number
16
- loop?: boolean
17
- }
18
- export class SpineSkeleton extends ComponentX<SpineSkeletonProps, Spine> {}
@@ -1,30 +0,0 @@
1
- import { EventManager, EventTypes, System } from 'entityx-ts'
2
- import { Spine } from './lib'
3
-
4
- import { NodeComp } from '../components/NodeComp'
5
- import { SpineSkeleton } from './SpineComponent'
6
-
7
- export class SpineSystem implements System {
8
- configure(event_manager: EventManager) {
9
- event_manager.subscribe(EventTypes.ComponentAdded, SpineSkeleton, ({ entity, component }) => {
10
- // console.log('SpineSkeleton', component)
11
- // const spine = entity.getComponent(SpineSkeleton)
12
- const { data, skin, animation, loop, timeScale } = component.props
13
- const node = Spine.from(data)
14
- // node.skeleton.scaleY = -1
15
- if (skin) {
16
- node.skeleton.setSkinByName(skin)
17
- }
18
- if (animation) {
19
- node.state.setAnimation(0, animation, loop)
20
- }
21
- if (timeScale) {
22
- node.state.timeScale = timeScale
23
- }
24
- component.node = entity.assign(new NodeComp(node, entity))
25
- })
26
- }
27
- // update() {
28
- // throw new Error('Method not implemented.');
29
- // }
30
- }
@@ -1,11 +0,0 @@
1
- import { GameWorld } from '..'
2
- import { SpineSystem } from './SpineSystem'
3
-
4
- export * from './SpineComponent'
5
- export * from './SpineSystem'
6
-
7
- export function setupSpine() {
8
- GameWorld.Instance.systems.add(SpineSystem)
9
- // GameWorld.Instance.listUpdate.push(SpineSystem)
10
- GameWorld.Instance.systems.configureOnce(SpineSystem)
11
- }
@@ -1,138 +0,0 @@
1
- /** ****************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated July 28, 2023. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2023, Esoteric Software LLC
6
- *
7
- * Integration of the Spine Runtimes into software or otherwise creating
8
- * derivative works of the Spine Runtimes is permitted under the terms and
9
- * conditions of Section 2 of the Spine Editor License Agreement:
10
- * http://esotericsoftware.com/spine-editor-license
11
- *
12
- * Otherwise, it is permitted to integrate the Spine Runtimes into software or
13
- * otherwise create derivative works of the Spine Runtimes (collectively,
14
- * "Products"), provided that each user of the Products must obtain their own
15
- * Spine Editor license and redistribution of the Products in any form must
16
- * include this license and copyright notice.
17
- *
18
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
27
- * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *****************************************************************************/
29
-
30
- import { AttachmentCacheData, Spine } from './Spine.js';
31
-
32
- import type { Batch, Batcher, BLEND_MODES, DefaultBatchableMeshElement, Matrix, Texture, Topology } from 'pixi.js';
33
-
34
- export class BatchableSpineSlot implements DefaultBatchableMeshElement {
35
- indexOffset = 0;
36
- attributeOffset = 0;
37
-
38
- indexSize!: number;
39
- attributeSize!: number;
40
-
41
- batcherName = 'darkTint';
42
-
43
- topology: Topology = 'triangle-list';
44
-
45
- readonly packAsQuad = false;
46
-
47
- renderable!: Spine;
48
-
49
- positions!: Float32Array;
50
- indices!: number[] | Uint16Array;
51
- uvs!: Float32Array;
52
-
53
- roundPixels!: 0 | 1;
54
- data!: AttachmentCacheData;
55
- blendMode!: BLEND_MODES;
56
-
57
- darkTint!: number;
58
-
59
- texture!: Texture;
60
-
61
- transform!: Matrix;
62
-
63
- // used internally by batcher specific. Stored for efficient updating.
64
- _textureId!: number;
65
- _attributeStart!: number;
66
- _indexStart!: number;
67
- _batcher!: Batcher;
68
- _batch!: Batch;
69
-
70
-
71
- get color () {
72
- const slotColor = this.data.color;
73
-
74
- const parentColor: number = this.renderable.groupColor;
75
- const parentAlpha: number = this.renderable.groupAlpha;
76
- let abgr: number;
77
-
78
- const mixedA = (slotColor.a * parentAlpha) * 255;
79
-
80
- if (parentColor !== 0xFFFFFF) {
81
- const parentB = (parentColor >> 16) & 0xFF;
82
- const parentG = (parentColor >> 8) & 0xFF;
83
- const parentR = parentColor & 0xFF;
84
-
85
- const mixedR = (slotColor.r * parentR);
86
- const mixedG = (slotColor.g * parentG);
87
- const mixedB = (slotColor.b * parentB);
88
-
89
- abgr = ((mixedA) << 24) | (mixedB << 16) | (mixedG << 8) | mixedR;
90
- }
91
- else {
92
- abgr = ((mixedA) << 24) | ((slotColor.b * 255) << 16) | ((slotColor.g * 255) << 8) | (slotColor.r * 255);
93
- }
94
-
95
- return abgr;
96
- }
97
-
98
- get darkColor () {
99
- const darkColor = this.data.darkColor;
100
- return ((darkColor.b * 255) << 16) | ((darkColor.g * 255) << 8) | (darkColor.r * 255);
101
- }
102
-
103
- get groupTransform () { return this.renderable.groupTransform; }
104
-
105
- setData (
106
- renderable: Spine,
107
- data: AttachmentCacheData,
108
- blendMode: BLEND_MODES,
109
- roundPixels: 0 | 1) {
110
- this.renderable = renderable;
111
- this.transform = renderable.groupTransform;
112
- this.data = data;
113
-
114
- if (data.clipped) {
115
- const clippedData = data.clippedData;
116
-
117
- this.indexSize = clippedData!.indicesCount;
118
- this.attributeSize = clippedData!.vertexCount;
119
- this.positions = clippedData!.vertices;
120
- this.indices = clippedData!.indices;
121
- this.uvs = clippedData!.uvs;
122
- }
123
- else {
124
- this.indexSize = data.indices.length;
125
- this.attributeSize = data.vertices.length / 2;
126
- this.positions = data.vertices;
127
- this.indices = data.indices;
128
- this.uvs = data.uvs;
129
- }
130
-
131
- this.texture = data.texture;
132
- this.roundPixels = roundPixels;
133
-
134
- this.blendMode = blendMode;
135
-
136
- this.batcherName = data.darkTint ? 'darkTint' : 'default';
137
- }
138
- }