Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Flat Sprite

Started by EnochDagor 1 reply 450+ views
Original Post
EnochDagor
EnochDagor
I want to tell my Sprite object to lay flat... oVecCenter = New Vector3(16, 16, 0) oVecPos = New Vector3(0, 0, 0) oSprite.Draw(oTex, System.Drawing.Rectangle.Empty, oVecCenter, oVecPos, System.Drawing.Color.Red) Now, instead of rendering from 0, 32, 0 to 32, 0, 0 I want it to render from 0, 0, 32 to 32, 0, 0 Understand? In other words, I want it to lay flat along the X-Z Plane. How do I do that? -E
Enoch DagorLead DeveloperDark Sky EntertainmentBeyond Protocol
Armadon
Armadon
You will need to specify the ObjectSpace flag when calling the Begin() method of a Sprite. This will make the Transformations of the device apply. Then you can use the rotationX and rotate the sprite around that axis to lay it flat.

I hope this helps.
Take care.
EnochDagor
EnochDagor
I coulda swore I tried that already... I think when I did it before, I wasn't setting the device's world transform but instead, was only passing that transform into the sprite's SetWorldViewLH call... I dunno... it worked this time though, thanks!

-E
Enoch DagorLead DeveloperDark Sky EntertainmentBeyond Protocol

Topic Locked

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

Sign in to reply to this topic.