Author Topic: Adding UI Panel to a GameObject.  (Read 3551 times)

thraxst

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Adding UI Panel to a GameObject.
« on: March 04, 2014, 03:41:00 PM »
I am trying to add a UI Panel to a GameObject and I am having issues getting it sized properly. I attached a UIPanel to the GameObject and then added a Label and Sprite to it. I was able the resize the Label/Sprite to fit the object, but not the panel. The current result is text that is quite blurry. When I just use the regular UI Root object for Label, the text is much more crisp. Is there some other way to embed GUIs on GameObject.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #1 on: March 05, 2014, 08:18:15 AM »
Shrink the panel some more. If you look at the UIRoot's scale, it's 2 / Screen.height, resulting in a very small value.

thraxst

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #2 on: March 05, 2014, 09:11:11 AM »
So that is part of my problem, I can't seem to resize the panel. Also, there is no UIRoot object in my current scene, just the UIPanel attached to the monitor.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #3 on: March 06, 2014, 08:40:23 AM »
UIRoot is only useful for 2D UIs. It's not a crucial part. Only UIPanel is needed.

Why can't you resize it? Just adjust the inspector scale values.

thraxst

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #4 on: March 06, 2014, 08:58:28 AM »
Adjust the scale values on the UIPanel? All this did was make the label and texture huge.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #5 on: March 06, 2014, 11:20:34 AM »
As I mentioned, it must be really small in size. 2 / Screen.height that UIRoot scales itself to is 0.00185 on a 1080p screen.

thraxst

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Adding UI Panel to a GameObject.
« Reply #6 on: March 06, 2014, 11:47:52 AM »
Thanks for your responses, I wasn't thinking about it properly. For some reason I was thinking I need to make scale a larger number. Got it working.