1.4.2 • Published 3 days ago
@galacean/effects-plugin-spine v1.4.2
Galacean Effects Spine Plugin
Usage
Simple Import
import { Player } from '@galacean/effects';
import '@galacean/effects-plugin-spine';
Get Spine Resource List
import type { SpineResource } from '@galacean/effects-plugin-spine';
const comp = await player.play(scene);
const spineData: SpineResource[] = comp.loaderData.spineDatas;
Get Animation List / Skin List
- Get using functions
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name)
const { skeletonData } = item.spineDataCache;
const animationList = getAnimationList(skeletonData);
const skinList = getSkinList(skeletonData);
- Get from the
spineDatas
array
const comp = await new Player().loadScene(scene);
const { skinList, animationList } = comp.loaderData.spineDatas[index];
Get Duration of a Specific Animation
const animationDuration = getAnimationDuration(skeletonData, animationName);
Get Texture Creation Options
import { getTextureOptions } from '@galacean/effects-plugin-spine';
const { magFilter, minFilter, wrapS, wrapT, pma } = getTextureOptions(atlasBuffer);
Set Animation Mix Duration
- Set default mix duration for an animation (should be called before
player.play
)
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
item.setDefaultMixDuration(mix);
- Set mix duration for a specific transition (should be called before
player.play
)
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
item.setMixDuration(animationOut, animationIn, mix);
Set Playback Speed
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
item.setSpeed(speed);
Set Animation
- Set a single animation
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
item.setAnimation(animationName, speed);
- Set a group of animations
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
const animationList = [animationName1, animationName2, animationName3];
item.setAnimation(animationList, speed);
Development
Getting Started
# demo
pnpm --filter @galacean/effects-plugin-spine dev
Open in browser: http://localhost:8081/demo/
Frame Comparison Testing
Open in browser: http://localhost:8081/test/
1.4.2
3 days ago
2.0.0-alpha.11
5 days ago
1.4.1
7 days ago
2.0.0-alpha.10
6 days ago
1.4.0
15 days ago
1.3.2
17 days ago
2.0.0-alpha.9
17 days ago
1.4.0-beta.1
18 days ago
2.0.0-alpha.8
20 days ago
1.3.1
24 days ago
1.4.0-beta.0
24 days ago
2.0.0-alpha.7
25 days ago
1.3.0
27 days ago
2.0.0-alpha.6
27 days ago
1.2.6
1 month ago
1.3.0-alpha.1
1 month ago
2.0.0-alpha.4
1 month ago
2.0.0-alpha.5
1 month ago
1.2.5
1 month ago
1.2.4
1 month ago
2.0.0-alpha.3
1 month ago
1.3.0-alpha.0
1 month ago
2.0.0-alpha.1
2 months ago
2.0.0-alpha.2
2 months ago
1.2.3
2 months ago
1.2.2
2 months ago
2.0.0-alpha.0
2 months ago
1.2.1
2 months ago
1.2.0
3 months ago
1.1.8
4 months ago
1.1.7
4 months ago
1.1.6
4 months ago
1.1.5
4 months ago
1.1.4
4 months ago
1.1.3
5 months ago
1.1.2
5 months ago
1.1.1
5 months ago
1.1.0
5 months ago
1.1.0-alpha.3
5 months ago
1.1.0-alpha.2
5 months ago
1.0.1
5 months ago
1.1.0-alpha.1
6 months ago
1.1.0-alpha.0
6 months ago
1.0.0
6 months ago
0.0.1-alpha.3
6 months ago
0.0.1-alpha.2
6 months ago
0.0.1-alpha.1
6 months ago
0.0.1-alpha.0
6 months ago