Search Unity

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

Discussion in 'General Discussion' started by im, Mar 18, 2014.

  1. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    hidden in Unity 5 FAQ we find

    http://unity3d.com/unity/faq

    did someone says this spring? :)
     
  2. BrainMelter

    BrainMelter

    Joined:
    Nov 20, 2012
    Posts:
    572
    I believe it! They said it's F***ing close!
     
  3. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    Best news today :) Really looking forward to the update
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,406
  5. TheDMan

    TheDMan

    Joined:
    Feb 23, 2014
    Posts:
    205
    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.
     
  6. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    It really is going to happen this time.
     
  7. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Awwwww, but I was just getting used to clicking on the "is the new gui out yet dot com" link every day :(
     
    Seventh Stealth likes this.
  8. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    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.
     
    Last edited: Mar 18, 2014
  9. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    I'm just going to point out, the Spring thing was an error on the site, it's actually summer. Sorry for the mishap.
     
  10. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I hate it when websites convert the text to a completely different word.
     
  11. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    Yeah yeah, pull the other one.
     
  12. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    And in a couple of months we read

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

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    Hopefully it does, but only in the sense that every time a button event occurs, the editor just goes "Shake it, baby!"
     
  14. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    Haha yeah!
     
  15. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    Tell us more!
     
  16. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    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.
     
  17. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    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?
     
  18. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    Can I define the corner dimensions? For instance, could I define them like this?

     
  19. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Well you could do that with NGUI already if you set the top right corner to the same width as the bottom right corner.
     
  20. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    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,
     
  21. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    The new GUI system is based on NGUI so therefore should manage the above window display, although multiple colliders might be required to match the shape.
     
  22. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Well... while defining that would certainly be possible, how would you expect it to behave? Considering that the sizing works by manipulating verts and UVs on a plane if there's asymmetrical regions like you've got there then that has to result in some kind of non-uniform stretching in one of the regions. No problem if you're using flat colours, but for texture or gradients?
     
  23. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    Shouldn't be easier to just put an extra sprite down there?
     
  24. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    I use flats/things that stretch uniformly along their axes as it is now. I just whipped that together in like 5 seconds and really only added the noise because it helped break up the uniformity of the colour.
     
  25. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,653
    I smell another one of my silly little Unity Editor Toys in the pipeline...
     
  26. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,653
    It isn't. "Inspired by" might be more accurate but even then it's diverged quite a lot, as was said earlier in the thread.
     
  27. Per

    Per

    Joined:
    Jun 25, 2009
    Posts:
    460
    Can you use units other than UV (0.0 - 1.0) for positioning? i.e. pixel precision placement.
     
  28. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    It also broke up the example. ;)

    Anyway, as it would add "but if's" to the workflow I think Rodolfo has the right of it...
    ... which happens to be how I do this kind of stuff at the moment, too. It's a more robust solution that doesn't add pitfalls to the workflow.
     
  29. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    That's interesting, since it implies that the whole thing was scrapped since the NGUI developer was working on it? I'm pretty sure he's said in the past that when he came onto the job he started by using the then-current version of NGUI.
     
  30. snowconesolid

    snowconesolid

    Joined:
    Dec 9, 2011
    Posts:
    868
    awesome news! I am really looking forward to the new gui system coming to unity. Guess I will hold off on buying NGUI for now.
    So does anyone know if the new gui system will make creating universal gui's for different screen resolutions much simpler?
     
  31. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    Draw two horizontal lines and two vertical lines. That will divide your sprite in 9 slices. The corners are not scaled in any way. The top and bottom slices are only stretched horizontally, the left and right slices are only stretched vertically, and the center slice will be stretched both vertically and horizontally.

    In the example you give, the right side slice should be big enough to cover the bottom tab.

    The slicing is optional, you can set it to just stretch the sprite if you like.
     
    Last edited: Mar 19, 2014
  32. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    There are no colliders. It seems that they use the Rect Transform to detect the extents of a game object. This seems very different from NGUI.
     
  33. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    From the presentation in GDC, while you can tell that it is based on NGUI, they have really moved away from it. They made a clear effort to make it simpler to use and more integrated with existing tools (Animator, sprites). I would say it is _losely_ based on NGUI at this point.
     
  34. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    The hypertext component they demoed had text color, links, and italics. I am sure they have a few more options than that. I am not sure if the hypertext component came with unity or it was a third party component they were demoing.

    The regular text component could do 2 effects: shadow or outline, that is it. It would be great if they add other effects.

    The in game gui they demoed was a speech bubble. Essentially you can add a gui anywhere in your scene, it does not have to face the camera.


    I don't really understand the question, but I don't think they went into enough detail to answer this.
     
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
  36. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The HyperText component will not be included with Unity. It was made by Adam Mechtley, who's on our closed alpha/beta lists and have been testing the GUI. He gave us permission to show off the component in the presentation. It was shown to demonstrate how the API makes it possible to create custom components.
     
  37. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The normal text component will have the normal rich text formatting options, as well as a simplistic shadow (just offset; no blur) and stroke (just the text offset in four directions; only works for very thin strokes). We'd have liked to provide something better, but for version one it's either this or no effects at all, since we just don't have the time to implement a more sophisticated and complete effects system for the first version.

    Not very hard, no. This is the intended use case. You'll basically instantiate a prefab of yours for each element, and modify text or images in the instance according to your data. Then you'll add your prefab as a child to the grid GameObject and add it to the list of elements in the grid component.
     
  38. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    Is that it? That sounds really basic. Those are things you can do or almost do with the current GUITextures/GUITexts.

    How about the concept of floating? Can I create floating objects that act like floating divs in html?
    How about metrics? Can I query these objects about how wide they will be based on inputed text/markup?
    Support for inline elements? Can I add images or text-rects that will appear inline with the text of my parent element?
    Are there any concepts like stylesheets or inheritance?
    Are there any way of making shapes using vectorized graphics?
    Can I render an GUI-element using a custom shader? Is the currently used shader openly available, so it's easy to write a custom one?
    How is the underlying script support?

    The above are things I definitely assumed would be in the new GUI, in one way or another. There are more of course, but those were the things I thought or right away.

    What you are talking about; the concept of borders and anchoring, that's what they have been showing every time they have had a "new GUI", and really, it really isn't anything impressive at all.

    I really hope there's more to this, otherwise I am deeply disappointed.
     
  39. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I had thought it would work with 9 slice by just duplicating and tiling the "middle" slice, or like tiling vertically to "left" and "right", "middle" slices, while dupicating the "top" and "bottom" horizontally to avoid ruining textured GUI elements. But maybe I can only hope for such a thing... if that all makes sense haha

    EDIT doesnt ragepixel function like that?
     
  40. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    So if 4.6 is to be released this Spring then it will be released somewhere between March 20, 2014 and June 21, 2014 and before 4.6 is released they will release 4.5!

    So, we're talking 4.6 will be released sometime in the next 4 months!
     
  41. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    4.5 already came out, but it was specifically for console deployment, I believe.
     
  42. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    in the morning they say "spring" and in the afternoon they say "summer"
    I think.. No one knows when come out..

    I am very very very disappointed

    Ngui is one man team .. Ngui developer work for forum, tutorial, document, QA.. and other games..
    I hated ngui but now I think NGUI deverloper is super Genius
    Without him.. How difficult was this time? He is my hero..

    without him There is no ugui. We should not forget his contribution
     
    Last edited: Mar 19, 2014
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, that was 4.4.

    --Eric
     
  44. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    http://nooooooooooooooo.com/
     
  45. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194

    Yes

    $guiOddShape.png
     
    CarterG81 likes this.
  46. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    As one of the beta testers, we've been working with uGUI for a while now, and I can report that not only is it happening for real, it's shaping up very nicely indeed. We used an early beta in our Character Studio. That has given us the confidence to embark on implementing the entire game UI refresh using uGUI in the coming weeks. Because uGUI is still in beta, we do of course have a fallback.

    When uGUI arrives in Unity 4.6 there will be a lot of smiling faces.
     
  47. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    I've been waiting a LONG time for the new GUI. And, the timing on its release will be perfect - cause I have a major new project starting soon, and it now falls in the 5.0 upgrade cycle. Being patient let me skip directly from 3.x to 5.0, get the UI as soon as soon as it's released, and save a nice chunk of change!

    WOOT!

    Gigi
     
  48. Quiet-Pixel

    Quiet-Pixel

    Joined:
    Aug 23, 2013
    Posts:
    48
  49. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Unity 4.6.0 is in beta for quite some time now. The publisher likely submitted this asset with the beta version, what should never ever happen...
     
  50. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Well the new Unity GUI, plus the updated NGUI once the developer updates it to make use of the new Unity GUI, and the Daikon Forge GUI once it's updated to make good use of the new Unity GUI and then we have something useful on a case by case basis. I'm looking for a way to easily integrate the GUI into game play flow and not some screen blocking - obscuring halt to the game with every little thing.

    ... and it's not that the old Unity GUI wasn't useful and good but I have thousands of lines of code just to create a seemingly simple GUI with that.