Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

mirror a sprite?

Started by happysad Jan 20, 2005 at 12:35 PM 2 replies 1.1k views
Original Post
happysad
happysad
Hi all, I want to draw a mirrored version of a sprite, using the Sprite.Draw method. How can I do this? I work with C# and Managed DirectX 9, searched the documentation and couldn't find a way to do it. Also, for different reasons I use the Sprite.Transform for positioning and rotating my sprites. Can the mirroring be performed with Sprite.Transform?
Agony
Agony
Try something like throwing a Matrix.Scaling(-1.0f, 1.0f, 1.0f) in with your other transformations. A negative scale should mirror the sprite around that axis.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas nly, and not for things themselves." - John Locke o
jflanglois
jflanglois
I don't know how it's done in MDX, but you can apply a negative scaling along the axis you want to mirror.

[edit] beaten :(
happysad
happysad
Thank you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.