@safe-engine/pixi 8.4.7 → 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 (92) 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/helper/utils.d.ts +0 -6
  21. package/dist/helper/utils.d.ts.map +1 -1
  22. package/dist/helper/utils.js +0 -12
  23. package/package.json +6 -2
  24. package/.github/workflows/npm-publish.yml +0 -35
  25. package/dist/@types/safex.d.ts +0 -15
  26. package/src/@types/index.d.ts +0 -2
  27. package/src/app.ts +0 -91
  28. package/src/base/EnhancedComponent.ts +0 -38
  29. package/src/base/gworld.ts +0 -20
  30. package/src/base/index.ts +0 -14
  31. package/src/base/utils.ts +0 -23
  32. package/src/box2d-wasm/ContactListener.ts +0 -66
  33. package/src/box2d-wasm/PhysicsComponent.ts +0 -83
  34. package/src/box2d-wasm/PhysicsSprite.ts +0 -42
  35. package/src/box2d-wasm/PhysicsSystem.ts +0 -142
  36. package/src/box2d-wasm/debugDraw.ts +0 -249
  37. package/src/box2d-wasm/index.ts +0 -19
  38. package/src/collider/CollideComponent.ts +0 -257
  39. package/src/collider/CollideSystem.ts +0 -166
  40. package/src/collider/helper/Intersection.ts +0 -139
  41. package/src/collider/helper/utils.ts +0 -37
  42. package/src/collider/index.ts +0 -16
  43. package/src/components/BaseComponent.ts +0 -17
  44. package/src/components/NodeComp.ts +0 -442
  45. package/src/components/Scene.ts +0 -17
  46. package/src/core/Color.ts +0 -7
  47. package/src/core/LoadingBar.ts +0 -63
  48. package/src/core/NodePool.ts +0 -28
  49. package/src/core/Size.ts +0 -21
  50. package/src/core/Vec2.ts +0 -108
  51. package/src/core/director.ts +0 -11
  52. package/src/core/index.ts +0 -7
  53. package/src/core/loader.ts +0 -14
  54. package/src/core/math.ts +0 -22
  55. package/src/dragonbones/DragonBonesComponent.ts +0 -32
  56. package/src/dragonbones/DragonBonesSystem.ts +0 -35
  57. package/src/dragonbones/index.ts +0 -11
  58. package/src/gui/GUIComponent.ts +0 -155
  59. package/src/gui/GUISystem.ts +0 -125
  60. package/src/helper/utils.ts +0 -50
  61. package/src/index.ts +0 -21
  62. package/src/norender/NoRenderComponent.ts +0 -60
  63. package/src/norender/NoRenderSystem.ts +0 -67
  64. package/src/norender/Touch.ts +0 -37
  65. package/src/planck/PhysicsComponent.ts +0 -83
  66. package/src/planck/PhysicsSprite.ts +0 -43
  67. package/src/planck/PhysicsSystem.ts +0 -201
  68. package/src/planck/index.ts +0 -3
  69. package/src/render/RenderComponent.ts +0 -132
  70. package/src/render/RenderSystem.ts +0 -64
  71. package/src/richtext/RichTextComp.ts +0 -50
  72. package/src/richtext/RichTextSystem.ts +0 -26
  73. package/src/richtext/html-text-parser.ts +0 -87
  74. package/src/richtext/index.ts +0 -8
  75. package/src/spine/SpineComponent.ts +0 -18
  76. package/src/spine/SpineSystem.ts +0 -30
  77. package/src/spine/index.ts +0 -11
  78. package/src/spine/lib/BatchableSpineSlot.ts +0 -138
  79. package/src/spine/lib/Spine.ts +0 -894
  80. package/src/spine/lib/SpineDebugRenderer.ts +0 -615
  81. package/src/spine/lib/SpinePipe.ts +0 -203
  82. package/src/spine/lib/SpineTexture.ts +0 -143
  83. package/src/spine/lib/assets/atlasLoader.ts +0 -158
  84. package/src/spine/lib/assets/skeletonLoader.ts +0 -81
  85. package/src/spine/lib/darktint/DarkTintBatchGeometry.ts +0 -92
  86. package/src/spine/lib/darktint/DarkTintBatcher.ts +0 -186
  87. package/src/spine/lib/darktint/DarkTintShader.ts +0 -74
  88. package/src/spine/lib/darktint/darkTintBit.ts +0 -77
  89. package/src/spine/lib/index.ts +0 -43
  90. package/src/spine/lib/require-shim.ts +0 -43
  91. package/tsconfig.json +0 -18
  92. /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
- }