Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpopelyshev committed Sep 30, 2016
1 parent f025518 commit 73cff46
Show file tree
Hide file tree
Showing 13 changed files with 354 additions and 1,019 deletions.
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# pixi-spine

Spine implementation for pixi v4
Spine implementation for pixi v3 and pixi v4.

IMPORTANT! Following functions were renamed in pixi-spine 1.1.0:
IMPORTANT! Following classes and functions were renamed in pixi-spine 1.1.0:

```js
Atlas to TextureAtlas
Expand All @@ -13,6 +13,7 @@ setAnimationByName to setAnimation

addAnimation to addAnimationWith
addAnimationByName to addAnimation

hasAnimationByName to hasAnimation
```

Expand Down Expand Up @@ -47,23 +48,15 @@ declare module PIXI {

### How to use spine events

This is stupid, I know, that's java port, I'll fix this later. If you dont specify at least one function, it'll crash.

```js
animation.state.addListener({
/** Invoked when the current animation triggers an event. */
event : function(trackIndex, event) { alert('event fired '+event.data) }

/** Invoked when the current animation has completed.
* @param loopCount The number of times the animation reached the end. */
complete : function(trackIndex, loopCount) {}

/** Invoked just after the current animation is set. */
start: function (trackIndex) {}

/** Invoked just before the current animation is replaced. */
end: function (trackIndex) {}
})
animation.state.onEvent = function(trackIndex, event) { console.log('event fired '+event.data) }
animation.state.onComplete = function(trackIndex, loopCount) { console.log('track '+trackIndex+' completed '+count+' times') }
animation.state.onStart =function(trackIndex) { console.log('animation is set at '+trackIndex) }
animation.state.onEnd = function(trackIndex) { console.log('animation was ended at '+trackIndex) }
//same for track, if it exists
animation.state.addAnimation(0, 'walk', true);
animation.state.tracks[0].onEnd = function(trackIndex, count) { console.log('my track ended :)') }
```

### How to choose resolution
Expand Down
131 changes: 82 additions & 49 deletions bin/pixi-spine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/pixi-spine.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions bin/pixi-spine.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/pixi-spine.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 73cff46

Please sign in to comment.