Author Topic: UILabel in higher resolutions  (Read 3643 times)

fredxxx123

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
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
« Last Edit: March 20, 2014, 05:01:56 AM by fredxxx123 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel in higher resolutions
« Reply #1 on: March 20, 2014, 12:34:31 PM »
Yes, by using a higher-res font.

fredxxx123

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: UILabel in higher resolutions
« Reply #2 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel in higher resolutions
« Reply #3 on: March 26, 2014, 02:05:00 AM »
When something loses focus, it receives the OnSelect(false) notification. You can listen to it either directly by adding a script that implements that function, or by using UIEventTrigger.

Dynamic fonts will only be crisp if labels use the "keep crisp" option, or the UIRoot is set to fixed size with labels using fonts at their native size.