1.0.8 • Published 4 years ago

spineplayer v1.0.8

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

spinePlayer

based on spineruntimes-ts, include spine ver3.7 and 3.8. UMD package.

DEMO

Demo Code

Usage

import Spineplayer3_7 from 'spineplayer/build/SpinePlayer3_7'
import Spineplayer3_8 from 'spineplayer/build/SpinePlayer3_8'

// parentDom must have css rule 'position: relative'
let body1 = new Spineplayer3_7({
    parent: parentDom,
    pngUrl:spine3_7.png,
    atlasUrl:spine3_7.atlas,
    jsonUrl:spine3_7.json,
    reduceFramerate:true,
})
body1.on('loaded',()=>{
    console.log(body1.getAnimationList())
    body1.play('2')
})
let body2 = new Spineplayer3_8({
    parent: parentDom,
    pngUrl:spine3_8.png,
    atlasUrl:spine3_8.atlas,
    jsonUrl:spine3_8.json
})
body2.on('loaded',()=>{
    console.log(body2.getAnimationList())
    body2.play('1')
})

API

.on(key, func) must add key 'loaded'. all code should in callback.

.getAnimationList() return support animations list.

.play(name, loop) name: String, support animation. loop: Boolean.

.pause() pause

.resume() resume

.getSize() return size

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago