Author Topic: NGUI 3 upgrade feedback & questions  (Read 2604 times)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
NGUI 3 upgrade feedback & questions
« on: September 23, 2013, 04:46:58 PM »
Great job ArenMook! It was painless to upgrade my project from 2.7 -> 3.0! Only took me a couple of hours, and your readme files & video tutorials are much appreciated. Also very psyched to hear there will be an upgrade path for NGUI3 -> uGUI, whenever it finally gets in the wild. A few nagging concerns for me about NGUI3. Maybe just confusion on my part, needing clarification  :

Scaling of Sprites & Labels
Seems we now have two methods of scaling: a) the dimensions of the Widget can be adjusted by using the ngui handles == the dimensions fields in the inspector or b) the traditional way of adjusting the widget's transform with Unity transform
Is there anything wrong with just continuing to do (b)? It's the workflow I'm used to. Does it kill the drawcalls or anything bad like that? Any reason to use (a) if one doesn't want to?

Nesting of widgets allowed
This is great- has been a bit of orthodoxy that we've had to work around in the past, creating lots of empty gameobjects just as containers. Glad this constraint is removed. However, if we are doing (b) then I guess we could get into serious issues having non unit-scaled widgets parented  to other widgets?

Are there two event systems available via code now?
It seems that we can use UIEventListener, or the new EventDelegate stuff. And in the video you skipped over some lines of code using UIEventListener. Will both continue to work and be supported? I was surprised that my code like this still works:
  1. UIEventListener.Get (lastMoveButton).onClick += BoneGraph.instance.OnLastMoveButtonClick;

ChrisR

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: NGUI 3 upgrade feedback & questions
« Reply #1 on: September 24, 2013, 05:36:05 AM »
Obviously, I'm not Aren, but regarding scaling widgets - if you scale according to B) sliced, tiled and filled sprites won't adjust, meaning you get awkward stretching. And as you rightly pointed out, if you want to take advantage of nested widgets, you really don't want to scale like that.

You can still make uniform adjustments on B), just like you would use empty game objects as containers before. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3 upgrade feedback & questions
« Reply #2 on: September 24, 2013, 01:51:41 PM »
I agree with what ChrisR said.

In regards to the event system... UIEventListener will remain in place for now -- it's used to subscribe to remote events. UIButtonMessage will be gone in the future update, however -- replaced with the EventDelegate-based option, letting you trigger remote functions by choosing them in inspector. In the long run, I'd like to have only one option -- the latter (EventDelegate-based approach). And I would have done that for 3.0, but it just totally slipped my mind.