- Home /
Mobile Performance with GUI and Rotations
Hi.
I'm maing some GUI for a 2D mobile game and did some search to find the best way to implement it. I'm trying to make an arrow to rotate around a pivot in a 360º angle. So far I discovered:
For mobile, OnGUI is out of the question as discovered here, so we need to use the old GUITextures
Rotation is not possible with this GUITexture approach as discovered here
I need some kind of GUI component as it maintains proportions even with camera projection changes.
I don't want to use animations as it's direction it's determined by a changing angle value that updates continuously.
The question now is, I'm completly out of ideas, if I can only rotate with GUIUtility.RotateAroundPivot, how can I implement this without making it a performance issue?
If a more detailed explanation is required or do you have any question, please, ask, I'd be more than happy to answer.
Thanks and regards
Ooof. Well, bullet points one, two, and four aren't tractable, but bullet point three IS. Just create a sprite in the foreground that follows the camera, adjusting it as necessary. (Not sure what you mean about "maintaining proportions" since sprites do that.)
Thanks for your answer :). What I meant is that if Ichange the orthographic camera projection size I need to increase the scale of the item and its location based on that projection size change and I fear that it can "flicker" or something similar when fast changing projection size too fast.
I'm trying to do right know with sprites, when i'm done I will report if this is really the best solution or not :(
Why not use a second camera for displaying the arrow (and any other world GUI objects)? I use EZGUI for my interface work. All the objects are world objects. I use a separate camera for displaying the interface (EZGUI) elements.
Robertbu solution was the best I could find. Simple and effective. Thanks ^^. If you put it as a response I'll make sure to vote it :)
Your answer
Follow this Question
Related Questions
Getting low FPS in URP compared to SRP for the same Scene on mobile 0 Answers
2d game performance is bad in mobile, but giving 80 to 130 fps in pc, its physics game, help plz 2 Answers
Sprite renderer, bad perfomance on mobile 1 Answer
World canvas with screen space canvas performance mobile ? 0 Answers
Gui scaling problem 3 Answers