# Good inverting Sprite Algorithm?

**URL:** https://forum.kirupa.com/t/good-inverting-sprite-algorithm/267154
**Category:** flash
**Created:** [July 29, 2008, 8:05am UTC](https://forum.kirupa.com/t/good-inverting-sprite-algorithm/267154 "2008-07-29T08:05:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coggia](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@coggia](https://forum.kirupa.com/u/coggia)
#### Post date: [July 29, 2008, 8:05am UTC](https://forum.kirupa.com/t/good-inverting-sprite-algorithm/267154/1 "2008-07-29T08:05:20Z")

</div>

Hello,  
I 'd like to turn around a sprite object, so I use a new Matrix (-1, 0, 0, 1, sprite.x, sprite.y) to do this.  
But by Xscaling -1 it turnalso from the width of the Object.  
Explanation : My Sprite is at 0,0 with width of 100. when I use my matrix it’s again at pos 0,0, but with width -100.  
You can say that it’s easy, you just have to add the sprite.width to the sprite.x in the matrix transform, but as my objects are ruled with a Timer object, it’ll add 100 at each tick of clock…So the object will move itself at each tick of clock…

Anyone you have a good idea to submit ?..oh, and for some ‘technical reasons’ the sprites must stay at (0,0) in the librairy and not at (-50,0)…yes it would be too easy 😉

Forgot to tell :  
the[invert](http://livedocs.adobe.com/flash/9.0_fr/ActionScriptLangRefV3/flash/geom/Matrix.html#invert%28%29)() Matrix method isn’t good for me because I don’t have a way to tell the x & y coordinates to the function, if I use Invert(), it’ll place the sprite at (0,0) on the stage
