Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: N3uRo on September 09, 2013, 10:18:50 AM

Title: NGUI 3.0
Post by: N3uRo on September 09, 2013, 10:18:50 AM
Good job Aren and good move from Unity (I suppose you spoke with them about this)!!

I have the Standard version so I can't try it yet but thanks for letting us get close to NGUI 3.0 ≈ New Unity GUI!!
Title: Re: NGUI 3.0
Post by: ArenMook on September 09, 2013, 10:31:14 AM
Well, that's not entirely correct. NGUI 3 is Unity GUI-like, but they are still very different systems and use quite different code under the hood. My goal was to adjust NGUI so that it is more uGUI-like to facilitate a smoother migration process in the future. I basically threw caution to the wind this weekend and decided to go down on it like a fat kid on pie, fixing the most glaring issues with NGUI in the process. It was a long process, and I've attempted it twice before earlier this year, but this time I was successful.

The old UI layouts should upgrade without a hitch, but custom code will need to be updated due to the numerous changes with scale. Here are some tips for upgrading:

* Open each scene in your project, then save them. Make sure to enable all of your game objects, as the upgrade logic only kicks in once the widgets are enabled.
* Drag in your widget-using prefabs into the scene (so they show up), then apply the changes so that the prefabs also get upgraded.
* Globally replace "UICheckbox" with "UIToggle".
* UICheckbox no longer has a 'root', so go through your radio buttons and give them a group ID instead.
* If you've used widget's localScale at any point, change it to use width and height instead.
* UIWidget.localCorners gives you the final 4 vertices of the widget (bottom left, top left, top right, bottom right)
* UIWidget.worldCorners gives you the same vertices, but in world space. There is also UIWidget.innerWorldCorners, in case you need it.
* "Make Pixel Perfect" button is now just called "Correct", beside the widget's dimensions.

I'll modify this post as I think of more things in the future.
Title: Re: NGUI 3.0
Post by: N3uRo on September 09, 2013, 10:39:41 AM
I know that it isn't a copy&paste  ;D

I mean that It's great that we can now use some of the new Unity GUI improvements like widgets size, nested widgets and of course the very requested Z/Depth issues.
Title: Re: NGUI 3.0
Post by: dev_xprt on September 12, 2013, 12:03:12 AM
Hi,

Congrats ArenMook!!!. Looking forward to new features and updates. Good Luck :)


Dev
Title: Re: NGUI 3.0
Post by: ArenMook on September 12, 2013, 07:39:35 AM
I put more upgrading tips in the version notes themselves -- http://www.tasharen.com/forum/index.php?topic=11.msg27296#msg27296

I'd be curious to hear from Pro users if they've taken the plunge into 3.0. There have been quite a few improvements to the workflow that should result in a good amount of time saved over the course of the project, but only if they take a few hours to upgrade.
Title: Re: NGUI 3.0
Post by: N3uRo on September 12, 2013, 09:57:20 AM
I put more upgrading tips in the version notes themselves -- http://www.tasharen.com/forum/index.php?topic=11.msg27296#msg27296

I'd be curious to hear from Pro users if they've taken the plunge into 3.0. There have been quite a few improvements to the workflow that should result in a good amount of time saved over the course of the project, but only if they take a few hours to upgrade.

Are you going to release it on the Asset Store soon? I know that you release it first to pro users to do it gradually.

I want to try out please!!  :)
Title: Re: NGUI 3.0
Post by: ArenMook on September 13, 2013, 08:47:46 AM
Soon™ -- but I will likely include both 2.7 and 3.0 in the same package.

http://www.youtube.com/watch?v=OT0hTxjjkY4&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

:)
Title: Re: NGUI 3.0
Post by: N3uRo on September 13, 2013, 11:04:46 AM
Really nice tutorial for beginners. Good work Aren!
Title: Re: NGUI 3.0
Post by: Ferazel on September 13, 2013, 04:28:42 PM
Thanks for the tutorial Aren. I think that the system looks similar to what was shown at Unite for uGUI. The event system seems like a serious step forward and similar to uGUI. I look forward to looking into 3.0 when it is released to the masses. I hope there is still something like ButtonMessage script still where you can register for any message (Hover, Drag, Click, etc.) you want from the UICamera and forward it onto an appropriate receiver.

Also, a minor request in regards to uGUI. I think the way that you were able to look at the high-level UIPanel to analyze your draw calls for your specific UI space and see on which materials the draw call batching is breaking is really helpful. So I'm asking you to include something like a UIPanel material draw call breakdown in uGUI if possible rather than relying on the Unity game window stats window which doesn't list the materials like that.
Title: Re: NGUI 3.0
Post by: ArenMook on September 13, 2013, 10:16:05 PM
Unfortunately the detailed breakdown of the draw calls in uGUI is not likely to be there in 1.0 simply because all the batching is done on the C++ side, and as you can probably guess it's a relative black box from the C# side...

That said though, uGUI is more intelligent about how it does batching. Joachim (who wrote the batching logic for it) made sure that it actually checks to see if the widgets actually occlude each other before splitting up the draw call logic. In NGUI's case I simply split it up as soon as I detect a different material. So there are fewer reasons to analyze the uGUI's draw call hierarchy as it should theoretically do the thinking for you.

By the way, one of the reasons I did NGUI 3.0 is because I've been putting off work on NGUI almost entirely for the past ~4-5 months as I was focusing on uGUI, and I was growing quite weary of explaining the same Z vs Depth difference for the upteenth time.

This past weekend I was actually blocked by certain bugs on the uGUI side so I got frustrated and turned back to NGUI. One thing led to another, and I ended up coding like mad for a few days, working out my frustrations by fixing everything I could in NGUI. That's how NGUI 3.0 came to be. I am quite happy with it now... it's basically the system I personally wanted to have all along. uGUI is still better, of course (faster, more efficient, more powerful, and its delegate system is better to boot -- Tim Cooper's work btw) -- but the gap as been narrowed significantly.

But the best part is, NGUI is now much closer to how uGUI works, so going from NGUI 3.0 to uGUI is going to be quite simple -- which was the number one question I got at the last month's Unite conference.

Although, one thing I do find NGUI preferable to uGUI right now are the sexier looking class editors (inspectors). I can't do that in uGUI because it goes against Unity's inspector conventions. With NGUI I have the freedom to do whatever I want, and not be constrained by those silly "conventions". :)

P.S. And yes ButtonMessage and EventListener classes are still there if you want to use them -- though now there are less reasons to do so.
Title: Re: NGUI 3.0
Post by: dev_xprt on September 14, 2013, 12:12:21 AM
hi,

Thanks for the tutorial ArenMook. :)

Dev
Title: Re: NGUI 3.0
Post by: Bradamante3D on September 14, 2013, 06:48:14 AM
Hi,

you should put that text + a list of changes + some transition instructions in a big welcome post here on the forum. Not a good idea to spread that info among the version thread + this thread that was started by a NGUI user.

There are a lot of NGUI 2.x users out there. Some watched your Unite presentation on YouTube. Some are here on the forums. But a lot of them will be worried about the future of their projects, knowing that Unity will get a new GUI. I am not, because I watched the video and I read things here on the forum.

However, I was a bit suprised to hit the forums today, and see a version 3 going around without much introduction. I watched your intro tutorial on YouTube and had trouble figuring out how my 2.x workflows are affected.
Title: Re: NGUI 3.0
Post by: ArenMook on September 14, 2013, 10:01:07 AM
Version 3 is only available to Pro users right now. When it's out to everyone, there helpful info will be in a separate sticky post. The reason it's in the version notes post right now is because people get email notifications when I post there -- this way it reaches everyone who subscribed to it.
Title: Re: NGUI 3.0
Post by: Vonchor on September 19, 2013, 02:42:05 PM
Just idly curious - beginning a new project and I can do other things besides the GUI for a while. So I'm wondering approximately when the 3.0 "standard" version will be released. I'd like to avoid having to migrate if I can avoid it.
Title: Re: NGUI 3.0
Post by: ArenMook on September 19, 2013, 03:27:37 PM
Approximately this weekend.
Title: Re: NGUI 3.0
Post by: Vonchor on September 19, 2013, 03:54:42 PM
Thanks!   :)
Title: Re: NGUI 3.0
Post by: pahe on September 19, 2013, 04:05:18 PM
Will it be possible to set different atlases to one layer and z-sort the layer then? E.g. I have sprite A on atlas A and sprite B and C on atlas B.
Now I want to have sprite A in front of B and behind C. This couldn't be achieved at the moment, right?
Title: Re: NGUI 3.0
Post by: ArenMook on September 19, 2013, 04:06:37 PM
3.0 supports it just fine, and will create extra draw calls as needed. Just watch the video for it.

Also, Z is no longer used. Just depth.
Title: Re: NGUI 3.0
Post by: NaxIonz on September 19, 2013, 05:05:13 PM
3.0 supports it just fine, and will create extra draw calls as needed. Just watch the video for it.

Also, Z is no longer used. Just depth.

And it appears this is shared across panels?

It used to be that you could ensure that everything one a panel would be infront just by adjusting it's Z. And now, that's not the case, which makes it much more cumbersome to make sure a popup dialog or something like that is 100% infront of other UI.

And if you have a scenario where this could be 3-4 items deep, that's kinda a pain that they all share the same depth pool.
Title: Re: NGUI 3.0
Post by: pahe on September 19, 2013, 05:48:31 PM
Yes, is it shared across panels? To be more precise with the example:

I have a background and a foreground texture on one atlas and I have a character texture on another atlas. I want this character in front of the background, but behind the foreground.
This was not possible to achieve with 2.6.x afaik, so you had to separate the background and the foreground to own atlases (making it three atlases).

I'm not sure if this could also be achieved when using more UIPanels for that instead of atlases, not tried that one. But I would like to have several atlases and UIPanels and still want to share the depth sorting across these panels. So, is this possible? In the video (I saw it now twice, as I thought I had missed something) you only use one atlas, so it's clear that this will work.
Title: Re: NGUI 3.0
Post by: ArenMook on September 19, 2013, 11:26:16 PM
Yes, it's shared across all panels, and no, it's not cumbersome. Simply use high depth values for your popup, and its content will always show on top. You can also just select a window and hit CTRL+= a few times to bring it forward (doing so adjusts the depth of all the widgets underneath by +1 each time).

Furthermore, you get a list of all the widgets managed by the panel when you select them, including the draw calls those widgets end up in -- handy for debugging (new in rc2).
Title: Re: NGUI 3.0
Post by: pretender on September 20, 2013, 12:02:38 AM
Can NGUI 3.0 be effectively used with older Unity 3.5.7? I have not upgrade yet, since I have 3.5.7 Pro
Thanks!
Title: Re: NGUI 3.0
Post by: ArenMook on September 20, 2013, 12:03:13 AM
Yes, however CTRL+- and CTRL+= keys don't seem to work on 3.5.7.
Title: Re: NGUI 3.0
Post by: TokyoDan on September 20, 2013, 12:19:26 AM
So where can we get this. It's not in the Asset Store?
Title: Re: NGUI 3.0
Post by: ArenMook on September 20, 2013, 12:27:36 AM
It's only available to Professional users for now. I am still working on it.
Title: Re: NGUI 3.0
Post by: NaxIonz on September 20, 2013, 09:56:26 AM
Yes, however CTRL+- and CTRL+= keys don't seem to work on 3.5.7.

I have 3.5.7:
Cmd+- and Cmd= seem to work on the selected widget, but does not propagate down to all the children under this game object.

So there does not appear to be any simple fix to this shared depth system :-\
It's going to take hours to twiddle all these values for 100's of widgets, and then test over and over to make sure I don't still have some sandwiching happening.

It would have been MUCH better if the new depth system was panel specific. Oh well.
Title: Re: NGUI 3.0
Post by: NaxIonz on September 20, 2013, 10:38:27 AM
I just made this little class and stuck it on the root of my various menus/popups:


  1. [ExecuteInEditMode]
  2. public class DepthAdjuster : MonoBehaviour
  3. {
  4.   public bool m_apply = false;
  5.   public int m_delta = 0;
  6.  
  7. #if UNITY_EDITOR
  8.   public void apply_delta(UIWidget[] widgets, int delta)
  9.   {
  10.     if (widgets != null) {
  11.       for (int i = 0; i < widgets.Length; i++) {
  12.         widgets[i].depth += delta;
  13.       }
  14.     }
  15.   }
  16.  
  17.   private void Update()
  18.   {
  19.     if (m_apply) {
  20.       m_apply = false;
  21.       apply_delta(gameObject.GetComponents<UIWidget>(), m_delta);
  22.       apply_delta(gameObject.GetComponentsInChildren<UIWidget>(), m_delta);
  23.       m_delta = 0;
  24.     }
  25.   }
  26. #endif
  27. }
Title: Re: NGUI 3.0
Post by: ArenMook on September 20, 2013, 04:28:13 PM
As of RC2, CTRL+= and CTRL+- adjust the entire hierarchy by a single depth value (+1 or -1).

ALT+SHIFT+= and ALT+SHIFT+- moves the selected object (and all of its children) to the very front or back.

P.S. And no, depths wouldn't be better remaining panel-specific. They were like that pre-2.7, and that was a nightmare with the Z vs depth.
Title: Re: NGUI 3.0
Post by: nzen on September 21, 2013, 08:57:14 AM
Handles are bugged. They're off by default, but selecting anything like a button makes them appear as gray, which blocks right-clicking to look around.
Title: Re: NGUI 3.0
Post by: N3uRo on September 21, 2013, 09:40:27 AM
Hi Aren,

Glad you finally released 3.0 to all users.

I'm testing with the Examples scenes and I have some suggestions/wishes/questions:

1. UIWidgetContainer: What is the purpose of UIWidgetContainer besides graying and disabling handles? It only contains code in the inspector, the runtime class it's empty. I suppose we only are going to add it when we need to disable resize on scene view?

2. Event system: UIButton and some others like UISlider has the new event system that is really great and each has it's events "OnClick" or "OnValueChange". But why there is no generic event handler? Think UIButtonMessage/UIForwardEvents mixing into one "UIEventHandler" (or something like that) with that inspector look functionality. And also why UIButton has only "OnClick"?

3. Widget depth control shortcuts: In the US keyboard layout I suppose it works Ctrl+- and Ctrl+= for widget depth control but in Spanish layout the "=" key (triggered by shift+0) is with "0" so when I hit Ctrl+= it opens Unity version control Window that opens with Ctrl+0.

4. Tween control: The Tween system remains the same besides the inspector change. I always wanted a better control with "Pause", "Resume", etc... Now (correct if I'm wrong) it relies on the component state (enabled/disabled).

5. UIToggle and groups: Can you show in the inspector the groups in a way similar the the UIPanel widget dropdown? In a large project it can be really difficult to keep track of the group id without repeating it by mistake.

I was looking UIAnchor and the "Container" property that is a GameObject now and that's fine. Looking into the code I see that "CalculateRelativeWidgetBounds" now has an argument to include the inactive widget. Since which version is there? I had troubles with that in the past for not having this option.

Thanks Aren!
Title: Re: NGUI 3.0
Post by: Yukichu on September 21, 2013, 10:43:30 AM
I have a semi-NGUI 3.0 related question.  As you said earlier in this thread, "uGUI is still better, of course (faster, more efficient, more powerful, and its delegate system is better to boot" does this mean you recommend moving over to uGUI when it is released (and stable)?  What is going to happen to NGUI, and what will set it apart?

I would guess that would be an option for anyone having performance issues, though I haven't really run into NGUI slowing much down at the moment.  Actually, since I've ripped out all of my OnGUI and GUI stuff (there was a lot) it has been amazing.

Without getting into uGUI details, what are your thoughts?  I love NGUI and in particular that all of the code is available so I can see how something is being done and rework it for my project - such as the dragndrop item system, I saw how you did it and then reworked it for my needs.

NGUI 3.0 looks very awesome.  I'll probably upgrade soon.  Oh, and just to make sure it's known, even though I paid for NGUI like 2-3 weeks ago, I don't feel bad about my purchase even in the slightest with uGUI on the horizon.  Love this stuff.
Title: Re: NGUI 3.0
Post by: emperor1412 on September 21, 2013, 01:22:22 PM
Hi ArenMook, SpriteAnimation now works incorrectly in NGUI 3.0, there is something wrong with the position, can you check it please.
Title: Re: NGUI 3.0
Post by: ArenMook on September 21, 2013, 07:18:06 PM
Quote
1. UIWidgetContainer: What is the purpose of UIWidgetContainer besides graying and disabling handles? It only contains code in the inspector, the runtime class it's empty. I suppose we only are going to add it when we need to disable resize on scene view?
Did I not cover that in the 3.0 video? You can put the widget container script on anything -- like a window game object or a panel, and it will make it possible to select it as if it was a widget, and then move it around easily.
Quote
2. Event system: UIButton and some others like UISlider has the new event system that is really great and each has it's events "OnClick" or "OnValueChange". But why there is no generic event handler? Think UIButtonMessage/UIForwardEvents mixing into one "UIEventHandler" (or something like that) with that inspector look functionality. And also why UIButton has only "OnClick"?
Honestly? Because I forgot to add it. :P
Quote
3. Widget depth control shortcuts: In the US keyboard layout I suppose it works Ctrl+- and Ctrl+= for widget depth control but in Spanish layout the "=" key (triggered by shift+0) is with "0" so when I hit Ctrl+= it opens Unity version control Window that opens with Ctrl+0.
Ah yes, difference in keyboards... Fun times. Suggestion alternatives then? [] keys maybe?
Quote
4. Tween control: The Tween system remains the same besides the inspector change. I always wanted a better control with "Pause", "Resume", etc... Now (correct if I'm wrong) it relies on the component state (enabled/disabled).
Right, just enable or disable the component.
Quote
5. UIToggle and groups: Can you show in the inspector the groups in a way similar the the UIPanel widget dropdown? In a large project it can be really difficult to keep track of the group id without repeating it by mistake.
That's a novel idea. Probably.
Quote
I was looking UIAnchor and the "Container" property that is a GameObject now and that's fine. Looking into the code I see that "CalculateRelativeWidgetBounds" now has an argument to include the inactive widget. Since which version is there? I had troubles with that in the past for not having this option.
2.7.0 I think?
Quote
I have a semi-NGUI 3.0 related question.  As you said earlier in this thread, "uGUI is still better, of course (faster, more efficient, more powerful, and its delegate system is better to boot" does this mean you recommend moving over to uGUI when it is released (and stable)?  What is going to happen to NGUI, and what will set it apart?
I'll keep on supporting NGUI. Do I recommend moving to uGUI after it's out? Depends on the state of your project. Going from NGUI 3.0 to uGUI is going to be pretty easy, and I will likely even have tools to auto-upgrade your entire layout from NGUI 3.0 to uGUI. What will set the two apart? That remains to be seen, seeing as one of them is not even out yet.
Quote
Hi ArenMook, SpriteAnimation now works incorrectly in NGUI 3.0, there is something wrong with the position, can you check it please.
How so? Details are key.
Title: Re: NGUI 3.0
Post by: emperor1412 on September 22, 2013, 05:38:11 AM
How so? Details are key.

Hi ArenMook, the attachment contain the spritesheet atlases that I used to make spriteanimation. You'll see that one contains same size sprites worsk correctly, the other contains differents size sprites works incorrectly but it works correctly in NGUI before 3.0.0
Title: Re: NGUI 3.0
Post by: ArenMook on September 23, 2013, 05:20:26 AM
I will have a look, thanks.
Title: Re: NGUI 3.0
Post by: atmuc on September 23, 2013, 06:44:29 AM
is UIButtonTween removed from package?
Title: Re: NGUI 3.0
Post by: ArenMook on September 23, 2013, 06:52:18 AM
http://tasharen.com/ngui/docs/class_u_i_play_tween.html
Title: Re: NGUI 3.0
Post by: atmuc on September 23, 2013, 07:00:15 AM
thanks. can you make a list that show before/after sample codes for 2.7/3.0. it will be better for google/ngui forum search. i can find some info on video but i cannot search it :-)

i asked this class for playmaker actions are not compatible with 3.0. do you plan to update them? or notify who made them?
Title: Re: NGUI 3.0
Post by: ArenMook on September 23, 2013, 07:04:11 AM
Notify Alex, the author of Playmaker.

As for the list... getting married on Saturday, so my time is incredibly pinched right now. :) I'll do bug fixes, but more than that will have to wait until after.
Title: Re: NGUI 3.0
Post by: atmuc on September 23, 2013, 07:18:38 AM
marriage is a good excuse for delays :-) i do not exactly how to say in English; i wish a happy life to you and your wife. :-)
Title: Re: NGUI 3.0
Post by: broken on September 23, 2013, 08:20:23 AM
Hello!

1. How can I make a modal window in version 3.0?
My window background has BoxCollider, before there was a lower Z value, and it worked fine. Now all widgets Z value I set to 0 and i use only depth value. But I can push through the collider, so i need to work again with the Z value of the panel?

2. I have two panels (LobbyPreloader and Lobby), and I want to make a smooth transition between them. The second panel (Lobby) contains a list of items (Clipped Panel) that are initialized data in Lobby Awake(). I use the code from your manager states:
http://www.tasharen.com/forum/index.php?topic=4013.msg19568#msg19568 (http://www.tasharen.com/forum/index.php?topic=4013.msg19568#msg19568)
But there is a problem. This list of the second panel appears immediately without animation alpha. That is the first panel (LobbyPreloader) has not yet disappeared, and the second panel (Lobby) has not yet appeared, but the list of the second panel is already displayed on the screen without transition. I understand this is due to the fact that at the time of starting the transition, the panel still does not contain the elements of the list, and they can not be SetAlphaRecursive. How to solve this?

Thanks!
Title: Re: NGUI 3.0
Post by: Yukichu on September 23, 2013, 10:15:31 AM
1. How can I make a modal window in version 3.0?
My window background has BoxCollider, before there was a lower Z value, and it worked fine. Now all widgets Z value I set to 0 and i use only depth value. But I can push through the collider, so i need to work again with the Z value of the panel?

Could you adjust the Z value of the collider to be closer to the camera?

... and congrats Aren.  I think we need a congratulations on your wedding thread, and probably a link to your gift registry :p
Title: Re: NGUI 3.0
Post by: Darkness on September 23, 2013, 10:27:01 AM
Is there any way to scale labels now?  All of my text is huge now and I can't scale things back the way they were. 
Title: Re: NGUI 3.0
Post by: broken on September 23, 2013, 12:43:09 PM
Could you adjust the Z value of the collider to be closer to the camera?


Then I will need to set the same value of Z for current panel (where box collider is background).

2. Check for the version 2.7, there is a list with the second panel (Lobby) appears simultaneously with the second panel with a smooth transition of alpha.  In version 3.0 there is a different behavior

Of the differences observed in version 3.0 alpha in the inner Clipped Panel of the list (in the Lobby) does not change with alpha Lobby (parent panel). And also that every element of the list is itself a panel.
Title: Re: NGUI 3.0
Post by: ArenMook on September 23, 2013, 02:03:24 PM
@emperor1412: The issue has been fixed with 3.0.0c (released).

@Darkness: What do you mean? Just adjust the scale. It should be (1, 1, 1) by default.

@broken: In 3.0 position.Z is not used at all. To bring something to front, use NGUITools.AdjustDepth. Check how I use it in NGUIMenu.
Title: Re: NGUI 3.0
Post by: N3uRo on September 23, 2013, 03:07:14 PM
@broken: In 3.0 position.Z is not used at all. To bring something to front, use NGUITools.AdjustDepth. Check how I use it in NGUIMenu.

If you want to sort "Windows"? Suppose I have 3:

- W1
- W2
- W3

And I want to W2 be between 1 and 3. What should I do? It's not bring to the front.

In versions previous to 3.0 I simply change Z accordingly (and sometimes also add a Panel to "fix" the depth issues).
Title: Re: NGUI 3.0
Post by: ArenMook on September 23, 2013, 04:00:12 PM
Use AdjustDepth. Pass the game object for your window to it, and it will adjust the depths accordingly. For example -100 will push it back. +100 will bring it forward. I also have NGUIEditorTools.NormalizeDepths(); in the editor, and if there is a desire, I'll move it from the editor side to the runtime as well. AdjustDepth(1000) followed by NormalizeDepths will cleanly bring something forward.
  1.         static public void NormalizeDepths ()
  2.         {
  3.                 if (UIWidget.list.size > 0)
  4.                 {
  5.                         UIWidget.list.Sort(delegate(UIWidget w1, UIWidget w2) { return w1.depth.CompareTo(w2.depth); });
  6.  
  7.                         int start = 0;
  8.                         int current = UIWidget.list[0].depth;
  9.  
  10.                         for (int i = 0; i < UIWidget.list.size; ++i)
  11.                         {
  12.                                 UIWidget w = UIWidget.list[i];
  13.  
  14.                                 if (w.depth == current)
  15.                                 {
  16.                                         w.depth = start;
  17.                                 }
  18.                                 else
  19.                                 {
  20.                                         current = w.depth;
  21.                                         w.depth = ++start;
  22.                                 }
  23.                         }
  24.                 }
  25.         }
Title: Re: NGUI 3.0
Post by: emperor1412 on September 24, 2013, 08:34:17 AM
@emperor1412: The issue has been fixed with 3.0.0c (released).

That's great, what a good new, everything in my game is about sprite animation. Before 3.0.0, there were an issue like if 1 sprite in a panel is moveing then the whole geometry of the panel is rebuild, like that there is a huge performance lost every frame. Now although I'm not so sure how you batched sprite together and manage their geometry, but the problem seem to be solved. Can you talk a little bit about it.

One more thing is before I separate sprites by panel, manage the depth within a panel, each panel has different transform.position.z, but now as I see in previous post, it won't work anymore, the depth has to me manually managed over. All the widgets will be created at runtime and it turned out that all of them have the same depth which cause incorrect rendering.
I tried NormalizeDepths() at run time but it doesn't help to adjust the depth of widgets correctly. Is there a way to deal with it?
Title: Re: NGUI 3.0
Post by: ArenMook on September 24, 2013, 09:28:41 AM
You can just have your logic set the depth based on the Y position on the screen, or however else you were setting that Z.

As for what I changed... that's a long-winded question, and too much to talk about in this post. I'll just say that I redesigned how the batching is done for 3.0.
Title: Re: NGUI 3.0
Post by: nzen on September 24, 2013, 11:48:04 AM
Adjusting the Border setting for sliced sprites doesn't seem to update in realtime anymore, so you have to uncheck/check "Fill Center" to see it update.
Title: Re: NGUI 3.0
Post by: ArenMook on September 24, 2013, 12:29:58 PM
You must be still on 3.5.7, nzen.
Title: Re: NGUI 3.0
Post by: nzen on September 24, 2013, 03:11:15 PM
I'm using 4.2.1 making my own atlas with a clean project. The border adjusting fixed after adding another image to the atlas.

But now it's having all kinds of issues building atlases. Everytime I Add/Update an image it breaks some of the others that aren't selected. And it resets any settings in UIAtlas. I'm remembering to save the scene after changes too.

Here's a video of it — http://www.youtube.com/watch?v=En72eunmAKM
Title: Re: NGUI 3.0
Post by: ArvoAnimi on September 24, 2013, 03:50:43 PM
Same border settings and atlas crazyness issue here. But besides that, version 3 screams awesomeness all over.
Title: Re: NGUI 3.0
Post by: ArenMook on September 24, 2013, 06:01:14 PM
3.0.0d is what fixed atlas issues.
Title: Re: NGUI 3.0
Post by: Yukichu on September 24, 2013, 07:10:35 PM
OMG why didn't I just come here like 4 hours ago or something.  Atlas issues fixed.
Title: Re: NGUI 3.0
Post by: nzen on September 24, 2013, 07:30:36 PM
Yes, it's fixed now!
Title: Re: NGUI 3.0
Post by: mishaps on September 24, 2013, 10:16:53 PM
aren, the new notify bit in UIButton is very cool how u choose the method from a drop-down now! Getting rid of all my UIButtonMessage... happy days! Thank you!
Title: Re: NGUI 3.0
Post by: ArvoAnimi on September 25, 2013, 08:43:15 AM
Thanks Aren, will check latest version, and Congratulations on getting married!

Edit: Tried to download latest version but it's not 3.0.0d but 3.0.0c ... How do I get version d again?
Title: Re: NGUI 3.0
Post by: Tiktaalik on September 25, 2013, 01:42:08 PM
Using the 4.3 beta there's one error warning that is easy enough to resolve but I wanted to make sure my "fix" is reasonable.

In NGUITools.cs we have this bit of code that doesn't account for 4.3

  1. #if UNITY_EDITOR
  2. #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2
  3.                                 UnityEditor.Undo.RegisterUndo(t, "Make Pixel-Perfect");
  4. #else
  5.                                 UnityEditor.Undo.RecordObjects(t, "Make Pixel-Perfect");
  6. #endif
  7.  

Which I fixed by adding in:

  1. #if UNITY_4_3
  2.                                 UnityEditor.Undo.RecordObject(t, "Make Pixel-Perfect");
  3.  

I'm basically guessing at what what I'm supposed to do here. Having 4.3 call "RegisterUndo" gave me a warning that suggested that this new "RecordObject" function existed, but upon googling I couldn't find any information about it at all. This fix at least does get rid of the error and warning.

Is there some resource where new Unity API changes are listed? I have access to the Unity Beta Testing Google group, but searching for "RecordObject" yielded nothing.
Title: Re: NGUI 3.0
Post by: soofaloofa on September 25, 2013, 03:32:37 PM
I'm trying to upgrade my project and continuously have errors where my widgets cannot find the new scripts. (i.e. Missing Mono Behaviour on all widgets).

Steps I take:
1) Open new Scene.
2) Delete NGUI folder.
3) Import NGUI.
4) Double click on the NGUI 3.0.0 package.
5) Reopen NGUI Scene.

- All of my references are lost. Am I doing something wrong?

Thanks,

Kevin
Title: Re: NGUI 3.0
Post by: ArvoAnimi on September 25, 2013, 03:44:59 PM
Any of you guys got ngui 3.0.0d ? how'd you get it? I've updated it and always shows me the 3.0.0c txt
Title: Re: NGUI 3.0
Post by: ArenMook on September 25, 2013, 06:09:06 PM
@soofaloofa: Close Unity, delete the Library folder, open Unity. That should force Unity to update everything.

@ArvoAnimi: Note the upgrade procedure that involves deleting the NGUI folder, not just importing the updated package on top.
Title: Re: NGUI 3.0
Post by: broken on September 26, 2013, 12:03:55 AM
Hi!

Aren, can you write what changes between versions ngui 3.0 (c-d-e)?

Thanks!
Title: Re: NGUI 3.0
Post by: ArenMook on September 26, 2013, 02:03:17 PM
All bug fixes. Letter updates mean bug fixes.
Title: Re: NGUI 3.0
Post by: humaliens on September 26, 2013, 03:59:04 PM
Is 3.0e downloadable from the Asset store via Update - I keep getting 3.6.3 that shows on import selection. Clicking Update results in Waiting for Server message everytime.

thanks
Title: Re: NGUI 3.0
Post by: aidji on October 01, 2013, 05:06:07 AM
Hello i try to upgrade my project with last ngui from 2.6.xx

I have one error that i dont know how to get rid off:
  1. Assets/Editors/NGUI/Scripts/Internal/UINode.cs(49,52): error CS1061: Type `UIWidget' does not contain a definition for `visibleFlag' and no extension method `visibleFlag' of type `UIWidget' could be found (are you missing a using directive or an assembly reference?)
  2.  
and
  1. public int visibleFlag
  2.         {
  3.                 get
  4.                 {
  5.                         return (widget != null) ? widget.visibleFlag : mVisibleFlag;
  6.                        
  7.                 }
  8.                 set
  9.                 {
  10.                         if (widget != null) widget.visibleFlag = value;
  11.                         else mVisibleFlag = value;
  12.                 }
  13.         }
any idea?
Title: Re: NGUI 3.0
Post by: MrTact on October 01, 2013, 09:29:48 AM
This past weekend I was actually blocked by certain bugs on the uGUI side so I got frustrated and turned back to NGUI. One thing led to another, and I ended up coding like mad for a few days, working out my frustrations by fixing everything I could in NGUI.
So what you're saying is, if we want new NGUI features, we should piss you off?  ;D
Title: Re: NGUI 3.0
Post by: ArenMook on October 01, 2013, 06:15:19 PM
@deldama: There is no UINode anymore. You need to follow the upgrade instructions carefully that involve deleting the previous NGUI folder before importing the update.

@MrTact: That will have the opposite effect. :P
Title: Re: NGUI 3.0
Post by: N3uRo on October 02, 2013, 02:00:04 PM
Aren, about the Widget depth shortcuts that we talked about... Can you make it configurable? Maybe a simple window where you have an enum of KeyCode in combination with Ctrl key.

Thanks!
Title: Re: NGUI 3.0
Post by: ArenMook on October 02, 2013, 02:30:14 PM
Just edit them in the NGUIMenu yourself, N3uRo.