Author Topic: (!!!) Improving NGUI: Voice your opinion  (Read 169552 times)

Devil_Inside

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #75 on: November 24, 2013, 11:46:04 AM »
I try to make my UI "pretty", so I try to add tweens and fades wherever possible.
I'd really like to see some improvements in widget alpha nesting.
If I want to fade out a button, I'd have to tween both label and background sprite manually in the button script. What if the label is 50% transparent by default, I'd have to keep this default alpha value somewhere and use it in in the final button alpha calculation.. What if button's alpha is set to 0.25 to hide it, but another script changes the labels alpha to 1?

I know you've added panel alpha nesting, and that's a great feature! But I can't add every nested widget in it's separate panel, so some improvements in this domain would be really welcome!

charmandermon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 34
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #76 on: November 24, 2013, 02:47:54 PM »
I just wanted to say that I absolutely love the new drag and drop prefab support. I was able to make gui in like a fraction of the time.  Very well done!

I would also like to suggest a custom ngui window with all of the current available controls/widgets rather than hunting the project view for them.  I would imagine it to be more like a visual gui builder then, like visual studio and Xcode. 

Lastly Keep those new widgets coming that is freaking awesome how it is.



Thanks greatly!
Dustin

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #77 on: November 24, 2013, 04:49:03 PM »
Get out of my head, charmandermon! :)

I am going to be adding just that. The idea is to have a "prefab" window where you can place your commonly used controls so you can easily add them while making UIs.

P.S. I also snuck in the widget snapping feature in the rc3. I wonder if anyone noticed.

Devil_Inside

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #78 on: November 24, 2013, 05:18:45 PM »
The sprite gizmo sometimes interferes with default unity movement tools so I start rotating or scaling the sprite instead of moving it. I also never use the gizmo to scale or rotate, I do it within the inspector. Can you please add a way to disable the gizmo without folding the sprite component?
Edit: I feel stupid now. Just found how to turn off the handles from the NGUI menu.

nerophon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #79 on: November 25, 2013, 11:15:56 AM »
Hi ArenMook,

Sometimes the best way to figure out what could use improvement is to have an ui/ux designer tell you what they want... and suddenly you have to implement it somehow. That's happening to me right now, so I'll share some general details of what was required, plus my conclusions about what seemed to be needed.

Firstly, we're doing mobile, so we need something that looks good on many different screen sizes and resolutions. Of course, the first issue was pixel density. As mentioned by others, the proper way to do ui for mobiles is to have a layout that is pixel-perfect at Density Independent Pixel scale, then changes based on density rather than height. This keeps things like nav bars the same size, no matter what device you're on.

After that, I found figuring out how to use anchor / stretch to layout elements in the desired way was a bit clunky. I am happy to hear you are going to try something new. In respect of this, one task I had was to create a bar that stretched across the screen, containing three buttons laid out in a grid. I naturally thought of UIGrid, but the spec was for a fixed pixel space between the three buttons, with the buttons stretching equally to fill the space. UIGrid cannot do this as of now, so I had to do it manually. Therefore, perhaps a grid upgrade is in order? And what about those super awesome grids you find on the net these days that have various sizes of squares, e.g. www.ted.com? That would be cool.

Next is a gripe: I implemented a scroll view, without softClip, prior to 3.0.6. It worked fine after I looked at the examples for a bit. However, now suddenly in 3.0.6 it broke because there's an automatic change to softClip in Awake. So I went back in and commented it out. But why force softclip on scroll views? Our scroll-view just goes off the sides of the screen.

Also, because of the layout system, I had to write my own UIAnchor subclass called UIAxisAnchor for our scroll view, which anchors in a single axis only. This required changing some of your private methods and fields to protected, which has been mentioned by others. But also, it suggests that the stretch / anchor system is, as stated above, not really sufficient for all use cases.

Speaking of that, the spec for our scroll view was that the elements needed to be a specific number of pixels less wide than the screen width. Again, I couldn't find a way to do this directly with NGUI, so wrote a script that does it in update. Obviously, not super-efficient. Perhaps I will have it do it once on launch, or do a screen-size change event or something. Perhaps NGUI could provide this? Or maybe it already does... who knows?

A final thing I've been asked to do is rounded corners. Easy enough you say! But wait! How about rounded corners on dynamic images downloaded at runtime? Ahaha! Harder. So perhaps, as mentioned by others, some kind of ability to use non-quad meshes, or some other solution to the problem of "masking with alpha".

Okay, that's all for now. As I continue implementing things, perhaps I will encounter more ideas for improvements. If so, will post.

Many thanks,

Nicholas Bellerophon

EDIT: turns out the spec for the scroll-view actually asks it be an infinite loop, including auto-scrolling on a fixed period, with breadcrumbs indicating current location. Looks like I'll be doing a fair bit of work here to turn a standard NGUI scroll view into this "carousel" thing. Hope this is useful.
« Last Edit: November 25, 2013, 12:21:47 PM by nerophon »

Jaimi

  • Guest
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #80 on: November 25, 2013, 02:35:28 PM »
Support for "Skinnable UI". This is complex, but I think it could be done several ways: Sub-atlases that define UI elements. Named lookups of items. Import of Unity GUI skins. Etc. 

Basically, I'd still like to have all what ngui has right now, but with the option of simple prefabs that use a sub atlas or naming convention, so the textures can be swapped out to change the look. Example - changing the fantasy skin to a sci-fi skin.

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #81 on: November 25, 2013, 06:23:03 PM »
Granted, I haven't read the rest of this much, but...

I would like:

1.  More 'readable' code.  Much too often there are if/else statements with the executing code on the same line as the if/else.  Yes, it saves space but trying to read through the code to change something for customization becomes more mind-numbing than it should be.

2.  As stated earlier, more virtual methods so we can create extended classes without worrying about them breaking every time we upgrade.

3.  The 'lego structure' is fine, but I can see how you want to appeal to the masses in order to sell more product.  Do whatever you need to sell more product, which will ultimately result in better development.

4.  I haven't tried the new scrollable UI thing, but initially setting up the old one was... a complete and utter stupid headache, particularly in that the tutorials at the time neglected to state you needed a collider and some other steps.  I've vaguely looked at the new documentation and I hope it is better, as this would be one my wishes - better, up-to-date documentation.

5.  While I do not actually have a need for this (yet) being able to manually order the draw calls of objects could be interesting.  You'd just say, in whatever manner, 'draw this after the normal order of draw calls' so you could explicitly state what goes on top.  I know there are layers and their purpose works wonderfully; however, when items are within the same layer the draw calls are managed by the innards of the panels.  It seems it currently works on a 'last created, last drawn' system, which works great... but what if I wanted to always keep something drawn on top while in the same layer as others...  Yes, I understand it would result in more draw calls, but it would result in more flexibility.

6.  Other than that, just keep on truckin'.  I love NGUI.

charmandermon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 34
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #82 on: November 26, 2013, 02:13:39 AM »
I would like to request a multiple tab group window prebuilt widget in our new group of widget prefabs :)

Thanks
Dustin

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #83 on: November 26, 2013, 09:44:04 AM »
Nerophon: Masking with clipping can be doe by changing the shader used for the UITexture. See http://nickithansen.dk/masking-and-clipping-textures-using-shaders-in-ngui/

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #84 on: November 26, 2013, 01:20:47 PM »
A lot of us are asking for UIGrid/UITable alignment options (left/center/right)

fpuig

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 6
  • Posts: 34
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #85 on: November 26, 2013, 06:57:51 PM »
alpha nesting between widgets
I try to make my UI "pretty", so I try to add tweens and fades wherever possible.
I'd really like to see some improvements in widget alpha nesting.
If I want to fade out a button, I'd have to tween both label and background sprite manually in the button script. What if the label is 50% transparent by default, I'd have to keep this default alpha value somewhere and use it in in the final button alpha calculation.. What if button's alpha is set to 0.25 to hide it, but another script changes the labels alpha to 1?

I know you've added panel alpha nesting, and that's a great feature! But I can't add every nested widget in it's separate panel, so some improvements in this domain would be really welcome!

+1 to adding support for alpha nesting between widgets

On our UI we need to fade in/out buttons and parts of the screen. But making each of those buttons a separated panel add a couple of extra drawcalls which we would like to avoid as much as possible.

The ideal for us will be to be able of adding an empty widget on the root of the button in order to control the alpha of all the child widgets. Pretty much like how it works with the nested panels but without adding drawcalls.


UITweener options to initialize with the 'From' value

There are lot of places where we are using Tweeners for our UI animations. For instance, when enabling our main menu, we quickly move its buttons from outside of the screen into the right location but with different delays.

Those tweens are set by the artist on the editor and they are executed as soon as the screen is enabled. But given that they have a delay then they start in the position the widget is in the editor (inside the view area) and only after the delay time passes they get moved into the "from" location.

We modified the UITweener and UITweenerEditor to allow forcing the tweener to place the value into the "from" position as soon as its enabled.

UITweener:
  1.         public bool InitializeWithFrom = false;
  2.  
  3.         void OnEnable()
  4.         {
  5.                 if (enabled && InitializeWithFrom)
  6.                         OnUpdate(0, false);
  7.         }
  8.  
   
UITweenerEditor:
  1.         protected void DrawCommonProperties ()
  2.         {
  3.                 ...
  4.  
  5.                 if (NGUIEditorTools.DrawHeader("Tweener"))
  6.                 {
  7.                         ...
  8.  
  9.                         bool InitWithFrom = EditorGUILayout.Toggle("Init With From", tw.InitializeWithFrom);
  10.                         if (GUI.changed)
  11.                         {
  12.                                 ...
  13.                                 tw.InitializeWithFrom = InitWithFrom;
  14.                                 ...
  15.                         }
  16.                         ...
  17.                 }
  18.                 ....
  19.         }
  20.  

Maybe that or a similar approach could be implemented into the Tweeners so that the artist could schedule the animations without having to move the objects into the animation's initial values.

Rahaio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #86 on: November 27, 2013, 05:48:13 AM »
There are two suggestions I would like to make for improving NGUI:
• It would be great if you could add multiple objects as containers in the UIStretch, so you could tell a sprite to be as wide/high as sprite A plus sprite B plus sprite C. That would be very helpful for creating responsive interfaces.
• I would appreciate it if you could select the direction of the effect of the UIAnchor: horizontal, vertical or (as it currently is) both. If that worked it would be great if you could add two UIAnchors to a single object - one for horizontal positioning and one for vertical positioning. That would allow some cool UI animations.

nerophon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #87 on: November 27, 2013, 06:31:35 AM »
Nerophon: Masking with clipping can be doe by changing the shader used for the UITexture. See http://nickithansen.dk/masking-and-clipping-textures-using-shaders-in-ngui/

Ah, excellent! Thank you :)

agentsmith666

  • Guest
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #88 on: November 27, 2013, 07:07:13 AM »
Sorry but with version 3.0.6 having to "search Control" in the Project windows to find widgets is slow and painful.  Accessing the "Widget Wizard" from the menu without having to type anything and once opened can be kept opened, made it a lot faster to create UIs.  Now there's a "legacy" label next to the "Widget Wizard" which makes it seem like you're planning to move away from it.  Big thumbs down if you do.

Ugh... 

kenshin

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 24
    • View Profile
Re: (!!!) Improving NGUI: Voice your opinion
« Reply #89 on: November 27, 2013, 07:56:22 AM »
Please, absolutely improve UIInput adding: text selection, simple multiline for textarea (without using ctrl+enter)!

Thanks
Kenshin

PS: Also enable copy/paste will be a great feature for textfield and textarea
« Last Edit: November 27, 2013, 10:08:36 AM by kenshin »