Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by gheeler · Dec 06, 2012 at 03:23 PM · guiguistyleselectiongrid

Selectiongrid formatting with guistyle.wordwrap

Im using a selection grid for a simple table that i need to display. the window theyre in is fixed size with a fixed horizontal internal window and a scrollable vertical one. When an entry is too long i need it to use a new line like, say, excel would. by default the end gets chopped off

alt text

The only option in guistyle that seemed to make sense was guistyle.wordwrap. however when i set this to true it has the desired effect by going to the next line when neccessary but it also creates a huge gap between each one

alt text

i cant even see another entry in the window to show how big the gap is! Any ideas how i can fix this? or is there something else that provides a grid like selectiongrid?

 void OnGUI () {
         windowRect = GUI.Window(0, windowRect, GuiFunc, "Record");
     }
     
     Rect insideWindow;
     
     void GuiFunc(int id) 
     {
         
         GUI.BeginGroup(insideWindow);
         
         scrollPosition = GUILayout.BeginScrollView(scrollPosition, new GUIStyle());
         GUILayout.SelectionGrid(0, gui, 2, listStyle);
         GUILayout.EndScrollView();
         
         if (GUILayout.Button("Close"))
         {
             mouse = false;
             guiOn = false;
         }    
         
         GUI.EndGroup();        
         GUI.DragWindow();
     }
 
 void Start () {
         windowRect = new Rect(Screen.width/2 - 170, Screen.height/2 - 150, 340, 300);
         insideWindow = new Rect(0, 0, 340, 1000);
         
         listStyle.normal.textColor = Color.white; 
         listStyle.padding.left =
         listStyle.padding.right =
         listStyle.padding.top =
         listStyle.padding.bottom = 4;
         listStyle.fixedWidth = 150;
         //listStyle.fixedHeight = 30;
         //listStyle.stretchHeight = true;
         listStyle.wordWrap = true;
         listStyle.clipping = TextClipping.Overflow;
         
         
     }


Comment
Add comment · Show 8
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image astorga · Dec 06, 2012 at 04:39 PM 0
Share

Can you show the script?

avatar image gheeler · Dec 06, 2012 at 04:43 PM 0
Share

added the code above

avatar image astorga · Dec 06, 2012 at 04:50 PM 0
Share

Last parameter shouldn't be "TextClipping.Clip"?

avatar image gheeler · Dec 06, 2012 at 04:53 PM 0
Share

that was another line i was testing. Its the same regardless of whether its not set, set to .overflow or .clip thanks for the suggestions

avatar image astorga · Dec 06, 2012 at 04:56 PM 0
Share

It's strange, looks like your string is filled with white space... Are you getting text from somewhere, or just putting strings directly?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by CaJerry87 · Dec 20, 2016 at 07:46 AM

This should answer what you're looking for. "How to Adjust the width and Height of your BeginHorizontal or BeginVertical" which helps with Custom Inspector Layout... http://answers.unity3d.com/answers/1288008/view.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Styling an individual button in SelectionGrid 0 Answers

SelectionGrid layout and style issues 1 Answer

GUI style causing problem 0 Answers

Is it possible to detect which GUIStyleState is used? 2 Answers

SelectionGrid is not returning a value!! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges