x


UnityGUI or normal GUI elements?

Hey there,

I've been looking through all my scripts and generally I tend to use both elements of both UnityGUI and the normal GUI system. I was wondering what the best approach to GUI would be? Would it be best for, say consistency and more options, to use only UnityGUI? Or would it instead be best to use a combination of both systems? Personally, I think that the normal GUI system (GUITextures and GUITexts) is super clunky in terms of positioning, etc., but it's easy for editing styles and textures, etc.

In short, what does everybody else think?

Thanks, Klep

more ▼

asked Apr 08 '12 at 01:47 PM

Kleptomaniac gravatar image

Kleptomaniac
2.5k 6 11 21

Hmmm. I personally find it more comfortable to use the OnGUI and not the game objects for gui. I already wrote a couple of base classes to have it more easy to configure gui so, editing styles and textures, given you take such a route is pretty quick. That said, performance wise, your best practice would be to use one of the 2D packages sold in the asset store, as they use texture atlas which can reduce your drawcalls by the hundreds, and that could be a serious performance boost for your game. Configuring the gui using these packages is also simple enough.

Apr 08 '12 at 01:54 PM GuyTidhar

Ah yeh? Mind linking some good ones? :P

Apr 08 '12 at 02:00 PM Kleptomaniac

"ez gui" is a known one, though a few others popped up since it was released (which is even before the asset store existed). Maybe NGUI is worth a look too.

Apr 08 '12 at 02:11 PM GuyTidhar
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Normal GUI isn't that clunky once you reset the transform's position and only use pixelInset to place your textures.

Both are really poor performance wise (1 draw call per texture), but OnGUI is worse apparently. Plus OnGUI is not multitouch, so pretty useless in certain cases...

It can be faster for quick prototypes, though.

There's a lot of positive talk on NGUI these days, you might want to check it out too.

more ▼

answered Apr 08 '12 at 02:06 PM

gregzo gravatar image

gregzo
1.6k 31 40 51

Hmm, don't think I really want to go spending any money at the moment. I think I'll probably end up just sticking with my current combination, and see how I go from there. Thanks for your help @guyt and @gregzo!

Apr 08 '12 at 02:57 PM Kleptomaniac
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5075
x3682
x13
x1

asked: Apr 08 '12 at 01:47 PM

Seen: 624 times

Last Updated: Apr 08 '12 at 02:57 PM