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. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    In A.D. 2101
    Unite was beginning.

    HELGASON : What happen ?

    TESTER : Somebody set up us the crash.

    DEVELOPER : We get signal.

    HELGASON : What !

    DEVELOPER : Main screen turn on.

    HELGASON: It's you !!

    BUGS : How are you gentlemen !!

    BUGS : All your GUI are belong to us.

    BUGS: You are on the way to destruction.

    HELGASON : What you say !!

    BUGS : You have no chance to release make your time.

    BUGS : Ha ha ha ha ....
     
    Last edited: Aug 15, 2014
    Kirlim and Rodolfo-Rubens like this.
  2. zastrow

    zastrow

    Joined:
    May 23, 2012
    Posts:
    20
    goldbug and shkar-noori like this.
  3. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    In the keynote they announced that the GUI code will be open source.
     
  4. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,485
    Yes, new GUI is both available now (Public Beta) and it is Open Source. :)
     
    angrypenguin and Wyckthor like this.
  5. Wyckthor

    Wyckthor

    Joined:
    Jul 9, 2014
    Posts:
    2
  6. tarahugger

    tarahugger

    Joined:
    Jul 18, 2014
    Posts:
    129
  7. zastrow

    zastrow

    Joined:
    May 23, 2012
    Posts:
    20
    Unity 4.6 Beta seems pretty stable.
     
  8. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    So is there any specific place one could post questions/inconvenience/feedbacks about the new UI?

    I'll do it here in the meantime. I'm messing with events, and there's two things I'm not quite sure I'm a fan of.

    1. If you want to have a handler for say, a pointer enter event for a button, your handler must take a BaseEventData as an argument as opposed to PointerEventData because the functions list won't detect it - So say you wanted to fetch the pointerId or anything related, you'd have to cast it down to a PointerEventData. Redundant, and not very intuitive.
    2. I'm not quite sure how to receive right/middle mouse buttons. The OnPointerClick/Up/Down don't seem to catch anything but left clicks.
     
  9. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
  10. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    http://forum.unity3d.com/forums/developer-preview-4-6-beta.60/
     
  11. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    There's a whole dedicated forum section for it, nice. Thanks both.
     
  12. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Play with Unity 4.6. The most annoying thing is anchors system.
    1. I can't disable them if i would like to.
    2. I can't make my widget to have absolute left offset and relative right offset.

    When i working on layout system for my project i think a lot about how to implement it. And what i got now:

    LayoutObject - component that contains information about size of the object(also min/max limits of the object), padding, and references to left/top/right/bottom anchors.
    LayoutAnchor - component that have type(enum {Left, Right, Top, Bottom, MiddleVertical, MiddleHorizontal}), value(offset) and valueMode(enum {absolute, relative}) + methods to calculate is final position and list of objects to notify when parent layoutObject change size or position.

    When LayoutObject change size or position its notify all LayoutObjects that is linked to its anchors. Many LayoutObjects can be linked to one anchor and its doesn't know about context where its appear. Its right to do so because child GUI element should't know about how they should behave inside parent element, only parent GUI element can change layout by changing anchor values. And i think its SOLID way to layout.

    In Unity 4.6 i can bind many elements to one "anchor" but i have to create some extra GameObject(+1 GameObject, +1 RectTransform with lot of properties) that will increase runtime overhead, asset size, and loading time...
     
  13. MrBrainMelter

    MrBrainMelter

    Joined:
    Aug 26, 2014
    Posts:
    233
    Anchors are a difficult thing to get right in a UI system because there are many ways of doing them. For instance, I really don't like the way NGui does anchors. But some people are cool with them. Hopefully UT got a result that pleases most people, because it's going to be a very difficult thing to change post-release.

    Most layout systems operate in a top-down fashion. But many popular systems (html, flex, NGui, DFGui) also support bottom-up layout features as well. Sometimes the parent size is dependent on the size of the children.
     
    Last edited: Sep 1, 2014
  14. PrefabEvolution

    PrefabEvolution

    Joined:
    Mar 27, 2014
    Posts:
    225
    Any way if i would like to make my own layout system UT should expose ability to disable default anchors at all...
     
  15. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    One thing I found a bit tricky, is changing the width/height of a UI element from code. I really didn't know which property is relevant but I noticed in the RectTransform sometimes there's 'width'/'height' written or top/left, etc - There was no width/height properties code-wise - So I wanted to know what values they're displaying in their editor so I took at a peek at their RectTransform editor and saw that it's 'deltaSize' - It turns out that depending on your anchor/parent configuration, this size could act as width/height or an offset. Not very straight forward, nor counter-intuitive. I'd be nice if there's a straight-forward way to manipulate the width/height directly.
     
  16. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Again, I think it's best to discuss this in the Developer Preview section.