@galacean/effects-plugin-spine

中文文档
2.10.6发布于 2026/11/09MITTypeScriptESM + CJS近 30 天下载 2009

Galacean Effects player spine plugin

原始使用文档
文档目录12 节
  1. Usage
  2. Simple Import
  3. Get Spine Resource List
  4. Get Animation List / Skin List
  5. Get Duration of a Specific Animation
  6. Get Texture Creation Options
  7. Set Animation Mix Duration
  8. Set Playback Speed
  9. Set Animation
  10. Development
  11. Getting Started
  12. Frame Comparison Testing

Galacean Effects Spine Plugin

Usage

Simple Import

import { Player } from '@galacean/effects';
import '@galacean/effects-plugin-spine';

Get Spine Resource List

import type { SpineDataCache } from '@galacean/effects-plugin-spine';

const comp = await player.play(scene);
const item = comp.getItemByName('itemName');
const spineData: SpineDataCache = item.spineDataCache;

Get Animation List / Skin List

  1. Get using functions
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName('itemName');
const { skeletonData } = item.spineDataCache;
const animationList = getAnimationList(skeletonData);
const skinList = getSkinList(skeletonData);
  1. After starting, you can access it in the spineDataCache.
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName('itemName')
const { skinList, animationList } = item.spineDataCache;

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

  1. 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);
  1. 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

  1. Set a single animation
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);

item.setAnimation(animationName, speed);
  1. 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/

版本与发布记录

@galacean/effects-plugin-spine 共发布 273 个版本,首次发布于 2023/11/13;过去 12 个月发布了 49 个版本。

版本发布日期距今
2.10.6latest2026/11/096 天前
2.10.52026/11/069 天前
2.11.0-alpha.3alpha2026/10/2620 天前
2.11.0-alpha.22026/10/2125 天前
2.11.0-alpha.12026/10/121 个月前
2.11.0-alpha.02026/10/121 个月前

其他发布通道:latest-2.3.x → 2.3.8,experimental → 0.0.0-experimental-20250915,beta → 2.7.0-beta.0,latest-1.x → 1.6.10,alpha → 2.11.0-alpha.3。

关于 @galacean/effects-plugin-spine 的常见问题

@galacean/effects-plugin-spine 是什么?

Galacean Effects player spine plugin

如何安装 @galacean/effects-plugin-spine?

在项目目录运行 npm install @galacean/effects-plugin-spine,或使用 pnpm add / yarn add / bun add。

@galacean/effects-plugin-spine 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@galacean/effects-plugin-spine 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@galacean/effects-plugin-spine 可以商用吗?

@galacean/effects-plugin-spine 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@galacean/effects-plugin-spine 的下载量有多少?

根据 npm 官方下载统计,@galacean/effects-plugin-spine 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,009 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@galacean/effects-plugin-spine 还在维护吗?

最新版本 2.10.6 发布于 2026/11/09(6 天前);至今共发布 273 个版本,其中过去 12 个月发布了 49 个;首次发布于 2023/11/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。