- Home /
What's the most effecient way to rotate a texture?
Hello, in my inventory system, you could rotate your items 90 dgs clk/counterclk wise I only care about 90 dgs.
I'm currently doing this by using another texture, a 90-dgs-rotated one because this has to be done fast - but of course, this is on the account of memory and disk storage.
Is there a better way, more efficient but fast way to do the rotation? again 90 dgs is what i care about.
I have read other threads in the forums, but nothing that I found convenient.
Thanks all.
Hmm, I'm using NGUI, if that's what you meant. Be back in a couple of hours.
How did I miss that :D - The thing is, UnityGUI made me blind working on it for a very long time, it hasn't been a while since I migrated to NGUI, since the moment I migrated it's been offering me very simple yet powerful solutions to a lot of problems. I don't know why I haven't thought of rotating the item's icon, thanks for the re$$anonymous$$der :) - $$anonymous$$ove your comment to an answer so I could choose it.
Answer by robertbu · Aug 22, 2013 at 06:16 PM
Assuming that NGUI is like EZGUI in that it uses a texture atlas and that NGUI allows you to switch to an alternate "image" in the atlas, then switching to an alternate texture in the atlas is a very efficient way. If not...if you are really swapping whole textures...then it likely more efficient to rotate the NGUI element rather than swapping the texture.
Your answer
Follow this Question
Related Questions
How to fill texture that would be avaliable to ither shaders? 1 Answer
Blur / healing brush effect on specific area of a 2D texture 0 Answers
Why does my pixel art get ruined? 1 Answer
Texture rotation by renderer.material.SetMatrix 1 Answer
Pixels not equal size and thin white stripes between pixels 2 Answers