@galacean/engine-spine 4.2.1 → 4.2.3

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/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
- "version": "4.2.1",
2
+ "version": "4.2.3",
3
3
  "description": "galacean spine runtime",
4
4
  "name": "@galacean/engine-spine",
5
5
  "main": "dist/main.js",
6
6
  "browser": "dist/browser.js",
7
7
  "module": "dist/module.js",
8
+ "packageManager": "pnpm@9.3.0",
8
9
  "dependencies": {
9
10
  "@esotericsoftware/spine-core": "~4.2.66"
10
11
  },
11
12
  "peerDependencies": {
12
- "@galacean/engine": ">=1.4.0"
13
+ "@galacean/engine": ">=1.5.0"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@babel/core": "^7.26.0",
@@ -20,7 +21,7 @@
20
21
  "@babel/plugin-transform-object-assign": "^7.25.9",
21
22
  "@babel/preset-env": "^7.26.0",
22
23
  "@babel/preset-typescript": "^7.26.0",
23
- "@galacean/engine": "^1.4.0",
24
+ "@galacean/engine": "^1.5.0",
24
25
  "@galacean/engine-toolkit": "beta",
25
26
  "@rollup/plugin-babel": "^5.3.1",
26
27
  "@rollup/plugin-commonjs": "^16.0.0",
@@ -128,4 +129,4 @@
128
129
  },
129
130
  "types": "types/index.d.ts",
130
131
  "repository": "https://github.com/johanzhu/engine-spine.git"
131
- }
132
+ }
@@ -1,19 +1,18 @@
1
- import { AnimationState, Skeleton } from "@esotericsoftware/spine-core";
2
- import { BoundingBox, Buffer, Engine, Entity, Material, Primitive, Renderer, SubPrimitive } from "@galacean/engine";
1
+ import { AnimationState, Skeleton, BlendMode } from "@esotericsoftware/spine-core";
2
+ import { BoundingBox, Buffer, Entity, Material, Primitive, Renderer, SubPrimitive, Texture2D } from "@galacean/engine";
3
3
  import { SpineResource } from "../loader/SpineResource";
4
+ import { SpineMaterial } from "./SpineMaterial";
4
5
  /**
5
6
  * Spine animation renderer, capable of rendering spine animations and providing functions for animation and skeleton manipulation.
6
7
  */
7
8
  export declare class SpineAnimationRenderer extends Renderer {
8
- private static _defaultMaterial;
9
9
  private static _spineGenerator;
10
10
  private static _positionVertexElement;
11
- private static _colorVertexElement;
11
+ private static _lightColorVertexElement;
12
12
  private static _uvVertexElement;
13
+ private static _darkColorVertexElement;
13
14
  /** @internal */
14
- static _materialCache: Map<string, Material>;
15
- /** @internal */
16
- static _getDefaultMaterial(engine: Engine): Material;
15
+ static _materialCacheMap: Map<string, SpineMaterial>;
17
16
  /**
18
17
  * The spacing between z layers in world units.
19
18
  */
@@ -25,6 +24,14 @@ export declare class SpineAnimationRenderer extends Renderer {
25
24
  If this option is enabled, the Spine editor must export textures with "Premultiply Alpha" checked.
26
25
  */
27
26
  premultipliedAlpha: boolean;
27
+ private _tintBlack;
28
+ /**
29
+ * Whether to enable tint black feature for dark color tinting.
30
+ *
31
+ * @remarks Should be enabled when using "Tint Black" feature in Spine editor.
32
+ */
33
+ get tintBlack(): boolean;
34
+ set tintBlack(value: boolean);
28
35
  /**
29
36
  * Default state for spine animation.
30
37
  * Contains the default animation name to be played, whether this animation should loop, the default skin name.
@@ -111,6 +118,10 @@ export declare class SpineAnimationRenderer extends Renderer {
111
118
  * @internal
112
119
  */
113
120
  _clearSubPrimitives(): void;
121
+ /**
122
+ * @internal
123
+ */
124
+ _getMaterial(texture: Texture2D, blendMode: BlendMode): Material;
114
125
  private _clearMaterialCache;
115
126
  private _applyDefaultConfig;
116
127
  /**
@@ -1,8 +1,8 @@
1
1
  import { BlendMode, Color, Skeleton } from "@esotericsoftware/spine-core";
2
2
  import { SubPrimitive, Texture2D } from "@galacean/engine";
3
- import { SpineAnimationRenderer } from "./SpineAnimationRenderer";
4
3
  import { ClearablePool } from "../util/ClearablePool";
5
4
  import { ReturnablePool } from "../util/ReturnablePool";
5
+ import { SpineAnimationRenderer } from "./SpineAnimationRenderer";
6
6
  declare class SubRenderItem {
7
7
  subPrimitive: SubPrimitive;
8
8
  blendMode: BlendMode;
@@ -13,8 +13,8 @@ declare class SubRenderItem {
13
13
  * @internal
14
14
  */
15
15
  export declare class SpineGenerator {
16
- static VERTEX_SIZE: number;
17
- static VERTEX_STRIDE: number;
16
+ static vertexStrideWithoutTint: number;
17
+ static vertexStrideWithTint: number;
18
18
  static tempDark: Color;
19
19
  static tempColor: Color;
20
20
  static tempVerts: any[];
@@ -28,7 +28,6 @@ export declare class SpineGenerator {
28
28
  buildPrimitive(skeleton: Skeleton, renderer: SpineAnimationRenderer): void;
29
29
  addSeparateSlot(slotName: string): void;
30
30
  addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
31
- private _createMaterialForTexture;
32
31
  private _createRenderItem;
33
32
  private _expandBounds;
34
33
  }
@@ -1,6 +1,28 @@
1
- import { Engine, Material } from "@galacean/engine";
1
+ import { Engine, Material, Texture2D } from "@galacean/engine";
2
+ import { BlendMode } from "@esotericsoftware/spine-core";
2
3
  export declare class SpineMaterial extends Material {
4
+ private _blendMode;
3
5
  private static _spineVS;
4
6
  private static _spineFS;
7
+ /**
8
+ * @internal
9
+ */
10
+ _setTintBlack(enabled: boolean): void;
11
+ /**
12
+ * @internal
13
+ */
14
+ _setPremultipliedAlpha(enabled: boolean): void;
15
+ /**
16
+ * @internal
17
+ */
18
+ _setTexture(value: Texture2D): void;
5
19
  constructor(engine: Engine);
20
+ /**
21
+ * @internal
22
+ */
23
+ _setBlendMode(blendMode: BlendMode, premultipliedAlpha: boolean): void;
24
+ /**
25
+ * @internal
26
+ */
27
+ _getBlendMode(): BlendMode;
6
28
  }
@@ -1,4 +0,0 @@
1
- import { BlendMode } from "@esotericsoftware/spine-core";
2
- import { Material } from "@galacean/engine";
3
- export declare function setBlendMode(material: Material, blendMode: BlendMode, premultipliedAlpha: boolean): void;
4
- export declare function getBlendMode(material: Material): BlendMode;