is there a way to flip an event's sprite?

Hi guys.

Just wondering if there's an easy way to flip an event's sprite via code?

I know the normal way is to just to flip the sprite in Photoshop or whatever, but I'd like to save space on my sprite sheets if possible.

Thanks.
Find a character zoom plugin and use a negative zoom?
Yes, by setting its X scale to -1.
Find a character zoom plugin and use a negative zoom?

Yes, by setting its X scale to -1.

I already had Galv's sprite zoom. Didn't realize it could be used to flip a sprite. I should have considering it says so in the readme lol.

All sorted now. Thanks, guys. This is going to free up so much space for me.

EDIT: is there a way to do this without a plugin? I'd prefer that if possible.
I already had Galv's sprite zoom. Didn't realize it could be used to flip a sprite. I should have considering it says so in the readme lol.

All sorted now. Thanks, guys. This is going to free up so much space for me.

EDIT: is there a way to do this without a plugin? I'd prefer that if possible.
JavaScript:
SceneManager._scene._spriteset.findTargetSprite(/*your sprite here*/).scale.x = -1
Trihan's suggestion would work in MZ: findTargetSprite accepts a character or battler reference (e.g. $gameMap.event(123)) and looks up its sprite for you. By contrast MV is more strictly-coded, so you'd need something like (untested):
JavaScript:
SceneManager._scene._spriteset._characterSprites.find(
  s => s._character === $gameMap.event(123)
).scale.x = -1;

I'd just stick with Galv's plugin, unless it's causing you problems.

[Edit: corrected equality check, thanks @Trihan!]
Trihan's suggestion would work in MZ: findTargetSprite accepts a character or battler reference (e.g. $gameMap.event(123)) and looks up its sprite for you. By contrast MV is more strictly-coded, so you'd need something like (untested):
JavaScript:
SceneManager._scene._spriteset._characterSprites.find(
  s => s._character = $gameMap.event(123)
).scale.x = -1;

I'd just stick with Galv's plugin, unless it's causing you problems.
Your code will work but you need == rather than =. ^_^

I thought findTargetSprite was in MV as well, guess I misremembered!
Your code will work but you need == rather than =. ^_^
Oops. Corrected, thanks! 👋
Trihan's suggestion would work in MZ: findTargetSprite accepts a character or battler reference (e.g. $gameMap.event(123)) and looks up its sprite for you. By contrast MV is more strictly-coded, so you'd need something like (untested):
JavaScript:
SceneManager._scene._spriteset._characterSprites.find(
  s => s._character === $gameMap.event(123)
).scale.x = -1;

I'd just stick with Galv's plugin, unless it's causing you problems.

[Edit: corrected equality check, thanks @Trihan!]

That code didn't work for me. I'm already using a lot of plugins so perhaps one of those is stopping it. I guess I'll just stick with Galv's plugin like you suggested.

Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-flip-an-events-sprite.174872/