Lamberto Posted December 17, 2016 Share Posted December 17, 2016 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? Quote Link to comment Share on other sites More sharing options...
Parasyte Posted December 17, 2016 Share Posted December 17, 2016 Yep, the supported way is now `this.renderable.flipX()`. See the platformer example for usage: https://github.com/melonjs/melonJS/blob/bca659885eb2782d3730193843b94da2b58d6e88/examples/platformer/js/entities/player.js#L69-L75 We should probably remove the deprecated method on me.Entity ... Quote Link to comment Share on other sites More sharing options...
Lamberto Posted December 19, 2016 Author Share Posted December 19, 2016 Thank you for the explanation, I tried on Entity and it works just fine but on Sprite it don't working as expected: the sprite now don't disappears but it don't flips http://www.officinepixel.com/test/testCase_flip/ I've not found any mention of this new way on documentation. There is still Sprite.flipX() Sprite.flipY() in Sprite page with no mention of the fact it's deprecated in favor of a new way and in Renderable page there is any flip function available. Quote Link to comment Share on other sites More sharing options...
obiot Posted December 20, 2016 Share Posted December 20, 2016 ouch indeed... the fault at the new matrix transform mechanism, and it seems that the `autoTransform` flag is not enabled for me.Sprite (where it should be), but is for me.Entity. for now you can just add the following line in your object constructor and it should solve your issue : this.autoTransform = true; I'll add a proper fix in melonJS later this week, but anyway it will more or less be the same, so no worries if you forget to remove it later as well Quote Link to comment Share on other sites More sharing options...
Lamberto Posted December 21, 2016 Author Share Posted December 21, 2016 nice! thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.