Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Spine Events - Unexpected Behavior
Started by kilopop Jun 25 2016 08:29 PM

2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Anyone using events in Spine effectively?

 

We've noticed some odd results using the examples provided e.g. spineboy.

The following is happening which is unexpected:
- The first time animation is set does not trigger onStart but subsequent animation setting does.
- If loop is true, onComplete fires at the start of an animation.

Using Build 2016.2883 for Windows.

To drill down to specifics, here is some of the code with comments:

 
-- Events
state.onStart = function (trackIndex)
   print(trackIndex.." start: "..state:getCurrent(trackIndex).animation.name)
end
state.onComplete = function (trackIndex, loopCount)
   print(trackIndex.." complete: "..state:getCurrent(trackIndex).animation.name..", "..loopCount)
end

-- Animation calls
state:setAnimationByName(0, "walk", true)
-- onStart does NOT print
-- onComplete prints immediately when onStart is expected with: 0 complete: walk, 0
-- onComplete fires as expected at the end of each loop

state:addAnimationByName(0, "jump", false, 3)
-- onStart does print for jump: 0 start: jump
-- onComplete does NOT print but would have expected it to.

state:addAnimationByName(0, "run", true, 0)
-- onStart does print for run: 0 start: run
-- onComplete prints immediately after onStart with: 0 complete: run, 0
-- onComplete fires as expected at the end of each loop.

 



[TOPIC: post.html]
#2

Reaver

[GLOBAL: userInfoPane.html]
Reaver
  • Enthusiast

  • 87 posts
  • Corona SDK

Hi,

 

How recently have you updated the spine runtime? There was recently an update with bugfixes for the lua runtime. I'm not sure there was anything for events specifically but it might be worth a shot.



[TOPIC: post.html]
#3

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Hi Reaver, thanks for your reply. I asked the same question over at esoteric.com. Turns out it relates to known issues with state events. Read more here: http://esotericsoftware.com/forum/events-onStart-and-onComplete-bugs-6593


[topic_controls]
[/topic_controls]