Make "draw image" reflect grow block

twotimingpete

  • *
  • Posts: 1667
I don't use seperate images for my main character to face left and face right. I use the grow block to set it to -100% width, which in effect flips the sprite. I use this on my player and most the enemies, the reason being I use a lot of frames and art and this helps save file space.

I had the idea to use the "draw image of self" block for some interesting special effects, but the problem is that it does not reflect my "flipped" state, making it useless unless I go add a left version of each animation, unravel all the behavior to get it working that way instead of the old way, etc...

I realize not everyone uses the growth block this way, but at the same time I don't think it could hurt to make draw image do this.

out2lunch

  • Posts: 118
We use the same mirroring trick to save memory.  The problem is that none of the tweens work with "draw image", but it'd be great if they did.  You can control sort order better when you draw different elements together in one actor, such as a dialog box with a backer, text, and buttons.
Clacky Train has been released worldwide on the App Store!
Voodoo Zombie's 1.4.1 update has more bosses and magic items on the App Store!
Here's the Launch Trailer on YouTube.

Jon

  • *
  • Posts: 17524
If you don't need the tweening part of this, I wonder if the underlying scale properties could be directly changed to achieve the same effect.

out2lunch

  • Posts: 118
Do you mean actor.realScaleX?  I'm pretty sure I tried that and it didn't work.  I don't see any scaling in G.drawImage(), just rotation and translation.

EDIT: After messing with G.drawImage() in Flash, I am able to scale it and even mirror it.  So there's hope.

« Last Edit: December 17, 2013, 02:59:36 pm by out2lunch »
Clacky Train has been released worldwide on the App Store!
Voodoo Zombie's 1.4.1 update has more bosses and magic items on the App Store!
Here's the Launch Trailer on YouTube.