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 - fredxxx123

Pages: [1]
1
NGUI 3 Support / Re: UILabel in higher resolutions
« on: March 25, 2014, 12:33:25 AM »
Dear ArenMook,
Sorry, I haven't mentioned the details in the programming environment.

UIRoot's Scaling Style : FixedSize, 768
UILabel's Font Type : Dynamic

In the editor, the font is sharp and clear at the fixed size (952x768). But when scaling to free sizes, the font becomes blurry.
This way, when the window size in the WebPlayer is adjusted to a suitable size for the user, the fonts are unclear.
But apparently the UIlabels do get refreshed to a clear font when going fullscreen and changing the resolution.

We can provide our game link if you need.

----

Another question about UIInput:
Is it possible to get a notification/event when UIInput loses focus?

We have currently set an event in the setter of UICamera.selectedObject:

  1. static public GameObject selectedObject
  2. {
  3.         get
  4.         {
  5.                 return mCurrentSelection;
  6.         }
  7.         set
  8.         {
  9.            var ori = mCurrentSelection;
  10.                 SetSelection(value, UICamera.currentScheme);
  11.  
  12.             // broadcast event
  13.             if (value != ori && Event_OnSelectObjectChanged != null)
  14.                Event_OnSelectObjectChanged(ori, value);
  15.         }
  16. }
  17.  

We then check if the out-of-focus GameObject is UIInput (controlled by us), if yes, other related objects will be closed.

Is there any better way, or one where UICamera doesn't have to be changed?

2
NGUI 3 Support / UILabel in higher resolutions
« on: March 20, 2014, 04:36:59 AM »
Is there a way to make the UILabel(s) look clearer at higher resolutions?
Please check the attachment.

version NGUI 3.5.2

3
NGUI 3 Support / Re: Dynamic font support for NGUI
« on: March 05, 2013, 05:32:29 AM »
hello,
     
   when font texture rebuild, we have to update all labels.  Is there any solve else?

but how can I update labels disabled,  call MarkAsChanged() when OnEnable?

thanks!

Hi, I had the same problem before.
It's my way to solve that.

  1. private static void OnFontRebuilt()
  2. {
  3.         UIRoot[] roots = GameObject.FindObjectsOfType(typeof(UIRoot)) as UIRoot[];
  4.  
  5.         foreach (var r in roots)
  6.         {
  7.             UILabel[] labels = r.GetComponentsInChildren<UILabel>(true);
  8.             foreach (UILabel label in labels)
  9.             {
  10.                 if (label.font != null)  // here you can check more to make this correct.
  11.                 { label.MarkAsChanged(); }
  12.             }
  13.             // just check
  14.             //Debug.LogWarning(string.Format("{0} has {1} UILabel.", r.name, ((labels != null && labels.Length > 0) ? (labels.Length) : (0))));
  15.         }
  16. }
  17.  

I hope it will be helpful to you  :)

4
NGUI 3 Support / Re: Dynamic font support for NGUI
« on: February 22, 2013, 09:42:54 PM »
Hmm, I've seen that too, but it hasn't had any problems; all the characters are shown. Odd.

I had problem for that, issued when dynamic font rebuild texture.
In previous version, 'RegisterFont' was called before 'RequestCharactersInTexture'.

  1.             //JUDIVA, include symbols in font
  2.             RegisterFont(this);
  3.             if (UseDynamicFont)
  4.                 dynamicFont.RequestCharactersInTexture(text, dynamicFontSize, dynamicFontStyle);
  5.  

Before add 'UIFont.RegisterFont(UIFont font)', that can't make 'UILabel' changed flag(content will be incorrect) when font rebuild in my case.
thanks you  ;)

5
NGUI 3 Support / Re: 360 degree rotation
« on: December 10, 2012, 09:30:27 PM »
okay, i got it.
thx  :)

6
NGUI 3 Support / Re: 360 degree rotation
« on: December 10, 2012, 08:05:06 AM »
I try to changed ..
  1.    cachedTransform.localRotation = Quaternion.Slerp(Quaternion.Euler(from), Quaternion.Euler(to), factor);
To
  1.    cachedTransform.localRotation = Quaternion.Euler(Vector3.Slerp(from, to, factor));

It's a bad idea?

7
NGUI 3 Support / Re: UIAnchor's PanelContainer question.
« on: November 21, 2012, 03:28:57 AM »
If it's set to 'automatic', the maunalHeight will always equal Screen.height, so the equation will result in 0.5 anyway. Your change doesn't do anything.

Hi!
It's might equal to Screen.height in old version.. not sure.
But i just update my NGUI to 2.2.6c today, and i trace the 'maunalHeight', either PlayMode or EditorMode, no one change the 'maunalHeight' if Automatic checked.

thanks :)

8
NGUI 3 Support / UIAnchor's PanelContainer question.
« on: November 21, 2012, 01:25:55 AM »
The code at UIAnchor.cs line 109...

  1. ...
  2. if (panelContainer.clipping == UIDrawCall.Clipping.None)
  3. {
  4.     // Panel has no clipping -- just use the screen's dimensions
  5.     float ratio = (mRoot != null) ? (float)mRoot.manualHeight / Screen.height * 0.5f : 0.5f;
  6.     rect.xMin = -Screen.width * ratio;
  7.     rect.yMin = -Screen.height * ratio;
  8.     rect.xMax = -rect.xMin;
  9.     rect.yMax = -rect.yMin;
  10. }...
  11.  

When calculate the 'ratio', it's need to check 'UIRoot.Automatic'? or not?
I try to check automatic, then the UIAnchor positioned right like i want.

  1. //float ratio = (mRoot != null) ? (float)mRoot.manualHeight / Screen.height * 0.5f : 0.5f;
  2. float ratio = (mRoot != null && !mRoot.automatic) ? (float)mRoot.manualHeight / Screen.height * 0.5f : 0.5f;
  3.  

and...sorry for my English.  :P

Pages: [1]