I need to flip a sprite by its bottom line. I know theres a way to flip it by a scale
property. But that would be only a flip my its center. Searching the Pixi.js documentation wasn't helpful either.
I have no experience with Pixi, but from what I've read, you have to set the anchor property of your sprite to the bottom of the sprite, then scale by -1. Something like this; please note I didn't test it.
mySprite.anchor.y = 1; /* 0 = top, 0.5 = center, 1 = bottom */
mySprite.scale.y *= -1; /* flip vertically */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With