Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Erhune

Pages: [1]
1
NGUI 3 Support / Re: Changing scene makes the GUI all blurry
« on: January 29, 2014, 11:55:38 AM »
Nothing had 0.5 offsets anywhere, unfortunately.

After much trial & error, I put back the old code in UIAnchor to add the 0.5 offset, but *only* when I switch scenes, and it fixed my problem. But I must admit I'm not very satisfied with the solution, which is not very elegant code-wise.

I tried to use the new anchor system to anchor panels on the side of the screen, but I must admit that I couldn't get it working, even in very simple setups (I'm using 3.0.9f7). Here is what I tried to anchor on the top left corner of the screen. Using the following hierarchy:

UIRoot
   UICamera
   UIPanel
      My widgets

My first problem is clipping on the panel. I do not need clipping, but I cannot anchor if I don't have some. So let's say I use alpha clipping, with a 300x300 rect. I setup an advanced anchor on the panel, set the UICamera as the left anchor + 0, the UICamera as the top anchor + 0, and leave both right and bottom anchors to None. When I hit play, the widgets start on the top left corner, but then move to the center of the screen. Same effect if I use the UIRoot as reference instead of the UICamera. Any idea what I am doing wrong?

Also, small suggestion: adding a small button to reset the anchor reference to None would help tremendously (it's quite time-consuming to click the object selector, scroll all the way up, and finally choose None).

2
NGUI 3 Support / Re: Changing scene makes the GUI all blurry
« on: January 23, 2014, 08:27:54 AM »
I don't do any scaling at all. Only the UIRoot in the hierarchy has a non-1 scale.

I tried with UIAnchors or without, didn't make any difference.

What makes a difference though is translating my Panels by 0.5 in both X and Y. That restores the whole crispness of the GUI.

3
NGUI 3 Support / Changing scene makes the GUI all blurry
« on: January 22, 2014, 01:55:53 PM »
I have 2 scenes, each with their own GUI. They are supposed to run in 1280x720 only, are setup with a fixed-size UIRoot of 720, my Game view in Unity is also setup to display 1280x720, and is not resized. When I load any of the scenes in the editor, I have a crisp GUI, no problem.

But if I load one, then Application.LoadLevel(theOther), I end up with the GUI of theOther scene very blurry. All the sprites seem to be 1 pixel smaller in every direction, I can see joints between sprites that are positionned adjacently. The weird thing is all transforms are correct (position, scales, widget sizes...), the UIRoot scale is correct, the camera settings are exactly the same that if I just loaded the scene manually...

I noticed this by upgrading from 3.0.6 to 3.0.8, and tried again with 3.0.9f4 with the same results...

4
NGUI 3 Support / Setting UILabel.text doesn't compute the size instantly
« on: January 22, 2014, 01:50:09 PM »
Between 3.0.0 and 3.0.6, it used to be that setting a UILabel.text would compute the UILabel.width and UILabel.height right now. I used this all the time to compute my layout in many parts of my GUI. Now, I have to do that in a coroutine: set the text, yield until the next frame when the width and height will be computed, and reposition everything. Of course, that means I have a 1-frame flicker which I didn't have before.

I understand this computation must be delayed for performance reasons, but isn't there a way to force it? Something like UILabel.ComputeSizeNow()...

5
NGUI 3 Support / Re: Font & Atlas selectors very slow
« on: December 02, 2013, 01:49:50 AM »
I've made the loading of all assets optional. In the next update you will be able to click a button if you want all assets to be searched / loaded. Otherwise only the most recently used ones will show up (just like it was before).

Thank you very much, that's will be perfect!

6
NGUI 3 Support / Re: Font & Atlas selectors very slow
« on: December 01, 2013, 06:09:29 AM »
Curious. I take it you have a very large project?

We have about ~10.000 assets in the project. Definitely not "small", but we're still a 2-person team so I guess the "big boys" have way more than that.

7
NGUI 3 Support / Font & Atlas selectors very slow
« on: November 30, 2013, 09:07:41 AM »
After upgrading from 3.0.5 to 3.0.6f7, I've noticed that the font and atlas selectors (that previously displayed a list of recently used items, and now display everything) have become so slow that they're basically unusable (they freeze Unity for a good 10 to 20 seconds on my project, which has 1 atlas, ~10 fonts, + the content of the NGUI examples).

8
NGUI 3 Support / OnTooltip problems in 3.0.6
« on: November 29, 2013, 02:31:22 PM »
My tooltips worked fine in 3.0.5, but since upgrading to 3.0.6 (now at f6):
- if I set Tooltip Delay to > 0 on the UICamera, they tend to not appear (even though the GameObject having the OnTooltip(bool) script is highighted, as seen with the UICamera.Debug option)
- if I set Tooltip Delay to 0, they blink on/off every other frame

I'm just using the OnTooltip(bool) callback to show or hide them, nothing fancy here. I tried various settings on the UICamera without any change, but just for info my current settings are:
- EventType: UI
- Allow Multi Touch ON
- Sticky Tooltip ON
- Tooltip Delay: 0.1
- Raycast Range: unlimited
- Event sources: Mouse & Keyboard
- Mouse Drag: 4px
- Mouse CLick: 10px

9
3.0.6f6 has fixed it for me. Thanks!

10
I also have weird panel issues since upgrading from 3.0.5 to 3.0.6f5. All my panels have different depths, but some of them are not displayed sometimes. When I disable and re-enable their GameObject or just the UIPanel script from the inspector, they reappear, but they sometime make another one disappear. Refresh-ing them does not do anything.

11
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 23, 2013, 11:50:10 PM »
Better layouting (is that even a word?) support and snapping for widget positioning is the main feature for 3.0.7.

Fantastic !

3.0.6 has been the biggest update yet, feature-wise. The downside of making improvements is now I have to make some new videos to go with them!

As others have pointed out many times... NGUI is an uber powerful tool -- but learning it can be a challenge. So my main focus with NGUI 3 updates is to make it as easy to use as possible and to remove as much "wtf?" from it as I can.

Yeah, I admit that even after using NGUI for more than 1 year, I learned a few things I always overlooked from the new docs you posted recently. I think using the forum "wiki-like" with a topic for each feature/widget is a great idea!

12
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 23, 2013, 11:30:57 AM »
I don't have anything new to add, but I just want to add my voice to some previously made suggestions:

Better layout support.

Ex: I want to have a bunch of widgets lined horizontally, each of them with variable width (think UILabel for example), and some spacing between them. I want to center the whole bunch relative to another widget. Bad ASCII drawing:

            [Reference Widget]
[Variable 1]  [Variable 2]  [Variable 3]

There might be a solution with anchors, but when you start to have a variable number of variable-sized widgets, it starts to crumble, so I always find easier to write an ad-hoc script (thank you so much for UIWidget.width in 3.x, by the way, it made my life so much easier!)

Selection support in UIInput.

I use a OnGUI Input() for the chat in my game, because it has proper support of selection, copy&paste, all well integrated with the OS default controls. I would kill to replace those by a proper UIInput, for so many reasons (simplicity, positionning, performance, able to render to texture...)!

Styled text in UILabel.

Basically the subset of pseudo-HTML usable in GUITexts: in addition to colors (which we have now), mixing font styles (italic, bold), sizes... Even better would be: line spacing (I saw you're doing something about this in 3.0.6, but I guess it's one setting for the whole text, not per line/paragraph...), multiple fonts in one label, clickable "links" that send events, or maybe even embedding arbitrary widgets in the text flow...

--

That's all I have for my list to Santa Claus for this year :p Anyway thank you again for your work and listening to the community, and keep up on the excellent work! (the pace of improvements in 3.x is fantastic!)

13
NGUI 3 Support / Re: Font Maker corrupts atlas
« on: August 28, 2013, 06:04:56 AM »
I have the same problem here (Unity 4.2.0f4 Pro on Windows 7 Pro 64 bit with NGUI 2.6.4): every time I update my atlas, a few of the font prefabs that use sprites in this atlas get messed up. Just reassigning the same sprite in the Font inspector fixes the problem, but it's quite time-consuming to go over each font manually after every atlas update, so I've made 2 simple scripts:
- a Panel in my game that shows a sample of all the fonts I have in my project
- a small Editor script to loop over all the font prefabs and reassign the sprite, like this:

  1.  [MenuItem("LBM/Fix fonts")]
  2.     public static void FixFonts()
  3.     {
  4.         var fonts = Resources.FindObjectsOfTypeAll(typeof (UIFont)) as UIFont[];
  5.         Debug.Log(string.Format("Found {0} font(s):", fonts.Length));
  6.         foreach (var font in fonts)
  7.         {
  8.             var sprite = font.spriteName;
  9.             Debug.Log(string.Format("{0} with sprite {1}", font.name, sprite));
  10.             font.spriteName = "";
  11.             font.spriteName = sprite;
  12.             EditorUtility.SetDirty(font.gameObject);
  13.         }
  14.         Debug.Log("Don't forget to save the scene to commit all the changes!");
  15.     }

Note that the Editor script actually loops over all the fonts, but only the fonts that are *actually* used in the Scene view while the game is running are fixed (thus the test Panel that shows all my font, so I can fix them all at once)

Hope that helps some people who have the same issue, and of course I'm crossing fingers for a "real" fix of this bug, and not a workaround.

Pages: [1]