Jump to content

isCurrentAnimation()


Lamberto
 Share

Recommended Posts

I think this is the problem: https://github.com/melonjs/melonJS/blob/50597e86b39e5dd7a0efaf8aa74de1142013ffaa/src/renderable/sprite.js#L378-L379 When setting an animation, it replaces the name of the first frame with the animation name. As the animation cycles, the current frame will not have the name of the animation.

This [incomplete] workaround was added here: https://github.com/melonjs/melonJS/commit/a0e084ad68c58f6a9a0599982c6d4b39f02176f7

Link to comment
Share on other sites

ok, found it (I think).

 

sometimes, the name got overwritten in the setAnimationFrame method (I guess by that line) :

https://github.com/melonjs/melonJS/blob/master/src/renderable/sprite.js#L420

 

here is my quick fix for it, give it a try on your side to confirm it does the trick :

https://github.com/melonjs/melonJS/commit/54ebbbabc5e1bf980d7093310859a6d9511b2d00

 

we will have this ticket then to properly fix it (something with how the data is stored/used is wrong):

https://github.com/melonjs/melonJS/issues/824

Link to comment
Share on other sites

The quick fix does the trick nicely. Thank you very much!

I've found another weird thing.

http://www.officinepixel.com/test/testCase_flip/

It seems me.Sprite.flipX is deprecated and when is set true the sprite disappears. I've not found any information in documentation on this fact. Is flipX (and flipY) really deprecated? If so what's the alternative?

 

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...