Unity 4.6 with new GUI system to be released this spring!?

hidden in Unity 5 FAQ we find

did someone says this spring? :slight_smile:

I believe it! They said it’s fucking close!

Best news today :slight_smile: Really looking forward to the update

countdown (end of spring, summer starts)

Yeah I’ll believe it when I see it. They said the same thing back in 3.x version and it never happened then they backed out and said they never said any such thing.

It really is going to happen this time.

Awwwww, but I was just getting used to clicking on the “is the new gui out yet dot com” link every day :frowning:

1 Like

The talk on the new GUI just finished at GDC. It is so much simpler now. I love the new anchoring system and the event system.

No wonder they have not released it yet, they really moved away from NGUI, it almost looks like a rewrite compared to what they demoed last year.

That said, it is clearly not there yet. It looks very solid, but it still lacks some components such as input box and scroll views.

Can’t wait to get my hands on it.

I’m just going to point out, the Spring thing was an error on the site, it’s actually summer. Sorry for the mishap.

I hate it when websites convert the text to a completely different word.

3 Likes

Yeah yeah, pull the other one.

And in a couple of months we read

Really that thing is like Duke Nukem Forever :smile:
Hopefully it does not turn out like Duke Nukem Forever.

Hopefully it does, but only in the sense that every time a button event occurs, the editor just goes “Shake it, baby!”

Haha yeah!

Tell us more!

You start creating a canvas as a top level object, the canvas can be in world space or in screen space. Use screen space for full screen gui, and world space for 3d gui or in game gui.

Then in the canvas, you add a game object with a sprite to make a window. The sprite can be a regular unity sprite that gets packed into an atlas.
The sprite is sliced into 9 regions, the corners are not stretched, so it does not matter what the window size is, the borders look right.

Then inside the window object, you add buttons, text, etc.

GUI objects don’t have a Transform. Instead they have a Rect Transform. This rect transform has a built in anchor functionality relative to the parent object. This is why you make the button a child of the window.

You anchor stuff to any value between (0,0) and (1,1). (0,0) is the top left corner, (1,1) is the bottom right corner, (.5, .5) is the center of the window.

Suppose you anchor the top left and bottom left of an object to (0,0), and the top right and bottom right to (1,0), then the object stretches with the parent window. Each corner of an object can be anchored independently.

Lets say you want a button at the bottom center. add an object, anchor all corners to (0.5, 1) and move it where you want it. Add a sprite component to it with the button background. Then inside of that object, add another object, add a text component and anchor it to the center of the button.

Components have events, that you declare as a field. The component can invoke the event at any time.
Then in the editor, you click on the event, select an object, component and method you want it to call. You can add as many listeners to that event as you want.

A component can call animations, and these are the regular Unity animations, so when you move your mouse over a button , it will play an animation that scales the button. You can even animate the anchor, so you can have a button fly in and anchor to the center of the window.

Then there is some stuff for layouts, like grids, or aligning things vertically and horizontally.

They also showed an hypertext component that could render text with links and some text effects. You can listen to the click event to react to links.

It looks very intuitive and simple. It is a big improvement over NGUI and integrates beautifully with other features from unity. I am really looking forward to 4.6 now :). Perhaps when the RDF wears off I won’t be as excited lol.

Everything sounds awesome, I can’t wait, I can’t f* wait!! Okay, a couple of questions:
The text effects you mean are shadows, strokes and gradient?
In game gui that you say in the beginning could be those speech bubbles?
I don’t know if you’ll be able to answer this but, what if I had an array list of a custom class for my items, would be hard to instantiate buttons inside that grid with the correct icon, item name, and etc?

Can I define the corner dimensions? For instance, could I define them like this?

Well you could do that with NGUI already if you set the top right corner to the same width as the bottom right corner.

I’ve actually been running an in-house GUI solution of my own. At this point it’s not worth the cost of upgrading to NGUI since I have something that fits my needs for the time being, but a free in-engine feature could nicely supersede the limited system I’ve implemented,