Question for the gurus (best way to build a GUI)

I’ve seen and used four different mechanisms for UI design.

  1. Separate camera for all GUI work
  2. OnGUI calls
  3. GUITextures on the main camera
  4. GUI ‘objects’ that are children of the main camera.

Is there one of those that works best for iOS development? Is there any benefit to keeping all of the GUI on its own camera?

Thanks!
-Chilton

I would like to know as well :slight_smile:

zipper

Dont use OnGUI!!! Ever! It loads you up on draw calls and is terrible with touch. For a full UI/HUD/menu solution use this: http://forum.unity3d.com/threads/87917-Prime31-UIToolkit-Multi-Resolution-GUI-Solution-Ready-for-Use...and-it-s-free?highlight=uitoolkit

Interesting. I’ll try replacing my OnGUI calls with a simple GUITexture objects and see if that improves performance.

I’m still using 2.6.1, and I noticed that prime31 didn’t seem to like that too well. Any chance there’s a 2.6.1 (and iPhone 1.7) version?

-Chilton

@Chilton, there are a lot of .NET features used that aren’t available in the ancient Unity iPhone 1.7 or 2.6.1.

That wasn’t a dig at prime31, I just wanted to know if there were earlier versions of these tools. I assume by your answer that there are not.

Removing the OnGui calls, and using GUITextures appears to have sped things up a bit.

That’s awesome. Thanks for the suggestion!

-Chilton

Hey Chilton, I’ve been in the same boat and wrestled with various GUI solutions and for a free product, I wholeheartedly endorse prime31’s open-sourced UIToolkit. Beyond just the ease of use to get controls on your UI surface, the two points that stand out for me are the automatic resolution / HD texture awareness and the workflow pipeline for texture atlas management (facilitated by a separate program called TexturePacker – basically automates optimizing your UI atlases and generating a JSON metadata file the UI framework uses to find everything at runtime).

If you can take the plunge to Unity 3.x, I recommend that as well…night and day comparison to 2.x, and there is mention in the Unity roadmap for 3.5 that they are re-writing their internal GUI framework along the lines of what prime31 and others have done in the UI space for performance and ease-of-use.

Yeah it really is worth the upgrade to 3.x I’m afraid.