Author Topic: Label in "Default"-Layer looks weird  (Read 2342 times)

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Label in "Default"-Layer looks weird
« on: February 18, 2014, 11:41:25 AM »
Hey there.

So I wanted to use some Labels outside my UI because nGUI has that neat "ShrinkContent" option I like to use when the language of the game changes. Of course there is text outside the UI like speech bubbles or signs and so on.

1. I made an empty GameObject (Default-Layer) and attached the UIPanel to it
2. Created a Label-Object which immediately was set as child of the Panel, good so far.
3. Writing the text
4. Weird behaviour started when I try to change Dimensions

This is what it looks like when I create it and write something down


And this is what it looks liek when I change the dimensions to something like 8x4



What am I doing wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Label in "Default"-Layer looks weird
« Reply #1 on: February 19, 2014, 11:38:31 AM »
8x4? Leave the label's scale at (1, 1, 1). Change the scale of the panel if you must, not the label.

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Label in "Default"-Layer looks weird
« Reply #2 on: February 19, 2014, 02:43:09 PM »
I don't change the scale of the label. It's set to 1/1/1. As said, I only change the dimensions IN the UILabel component, not the Transform.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Label in "Default"-Layer looks weird
« Reply #3 on: February 19, 2014, 03:53:58 PM »
Ah, I see what you mean. I will look into it. In the meantime, consider scaling the panel down to a small size instead of adjusting the label's width and height like that. NGUI works best when the widget coordinates remain in pixels.

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Label in "Default"-Layer looks weird
« Reply #4 on: February 19, 2014, 05:10:27 PM »
Well, that doesn't get rid of the "problem", does it? When I scale the UIPanel-Object down, let's say to 0.1/0.1/0.1 the Text-Object gets smaller, too, but there will be some labels which have different Widths/Heights because of the size of the signs/speach bubbles/etc.
I can't set the UIPanel-Object in a uniform way to handle all Labels in the Level and I don't want to create for each Label an own UIPanel :/

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Label in "Default"-Layer looks weird
« Reply #5 on: February 20, 2014, 09:02:52 AM »
This should be already fixed in 3.5.0, but using small sizes is not recommended. As I mentioned, NGUI works in pixels, so your 8x4 widget is 8 pixels by 4 pixels, which is something that would essentially be a tiny dot on a normal screen.

UIRoot scales itself to 2 / Screen.height, for example.