Jump to content

pixi-spine: past events when setting trackTime


Qinxgee
 Share

Recommended Posts

Hi!

I've run into a problem with my spine implementation. In our application, we have certain animations that vary a bit depending on the orientation of the mobile device, so when the orientation changes, we check if a running animation is affected (by checking the animation name in all tracks), and if so, we start the sibling animation on the same track and set the trackTime to the trackTime of the old animation. When we do this switchover, all events that have already been fired, are fired again.

I assume that pixi-spine has some check at every update to fire all events that are set before the current time, unless they have already been fired. When we create the new track, this new track entry is not aware of any events already fired, so all events get fired again.

Is there a way to make the new track entry aware of the already fired events?

We're currently using pixijs 5.3.12 and pixi-spine 2.1.14 (yeah, I know...)

Link to comment
Share on other sites

If anyone else is having this same issue: it seems to be solved by calling `newAnimation.setAnimationLast(oldAnimation.animationLast)`. I have not seen other side-effects yet, so I'm going with it. It makes sense that on an update, events between animationLast and now are being fired.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...