Socket
Book a DemoInstallSign in
Socket

@galacean/effects-plugin-spine

Package Overview
Dependencies
Maintainers
15
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@galacean/effects-plugin-spine

Galacean Effects player spine plugin

latest
npmnpm
Version
2.6.6
Version published
Maintainers
15
Created
Source

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

  • 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);
  • 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

  • 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/

FAQs

Package last updated on 10 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts