Author Topic: How to properly set width for GUILayout in the inspector?  (Read 5348 times)

jjobby

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
How to properly set width for GUILayout in the inspector?
« on: April 16, 2012, 09:14:44 PM »
Hello, I have modified the inventory system script from the example. I can modify the script to work just like I want. But the problem is that GUI layout in the inspector got messed up when there are too many line spacing. You can see it in the image below.



If all contents can be shown in the inspector, the GUI layout looks fine. But if it's not then some buttons or panels got stretched like in the right image. How can I fix this problem?

By the way, first time post here. Thank you very much for great GUI tool. 8)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to properly set width for GUILayout in the inspector?
« Reply #1 on: April 16, 2012, 10:16:11 PM »
I don't have enough information to tell you what you're doing wrong, but even if I did... this is Unity's GUI system you're having an issue with. It's best to ask on the Unity's forums.

jjobby

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: How to properly set width for GUILayout in the inspector?
« Reply #2 on: April 17, 2012, 12:08:01 AM »
For your information, this problem also occurs in example 3 character from NGUI package. If I add many stat to the item then GUI layout in the inspector got messed up like I've described.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to properly set width for GUILayout in the inspector?
« Reply #3 on: April 17, 2012, 12:10:32 AM »
It's just the scroll bar covering up the side.

jjobby

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: How to properly set width for GUILayout in the inspector?
« Reply #4 on: April 17, 2012, 12:19:32 AM »
Hmm, this is what happened to me.



I don't know. May be something is wrong with my Unity. ???
I will re-install and try again then.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to properly set width for GUILayout in the inspector?
« Reply #5 on: April 17, 2012, 12:22:04 AM »
Looks to me like you drew something very wide, possibly specifying a width way in excess of ~300 pixels that the window seems to be.  Even the transform widget is only showing half of it.