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
0
Question by RFAronson · Jan 31, 2012 at 11:41 PM · textguilayoutformatting

Bullet Points

I need to display instructions to my Unity Project and my employer would like them to display with bullet points (leading o, see the Formatting Buttons on the right when you ask or edit a question) at a fixed indentation. I have found nothing like this so far in GUILayout options. I need to use ScrollView because the instructions may be too large for the screen (especially if we deploy to tablets). I'm not even finding an easy way to have a fixed horizontal starting point so I can display a preceding lower case "o" as the bullet. Any suggestions? My pertinent code:

function Start() {

...

 scrollPosition.x = 0;
 scrollPosition.y = 0;

...

 instructionText = instructionText + "  Click 'Add Tower' to create another tower, then drag it to where you want it.";
 instructionText = instructionText + "  All towers must be in the radio net (i.e. each tower must be able to talk to at least one other tower) and should be on the AO (on the red).\n\n";
 instructionText = instructionText + "Click 'Check Results' to see your solution in action.  You can try as often as necessary.";
 instructionText = instructionText + "  Use as many towers as necessary to fully cover the AO, but don't waste resources by using too many towers.";
 instructionText = instructionText + "  Towers need line of sight (LOS) to each other.  Terrain may block signals.\n\n";
 instructionText = instructionText + "After each attempt, you'll pass or receive more information.  Good luck!\n";

... longString = instructionText;

}

function OnGUI() {

     scrollPosition = GUILayout.BeginScrollView(
     scrollPosition, GUILayout.Width(650), GUILayout.Height(450));
     GUILayout.Label(longString, customStyle);
     GUILayout.EndScrollView();

...

}

Thanks in advance, Richard Aronson

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by RFAronson · Feb 09, 2012 at 12:32 AM

My solution is to:

1) Change the Alignment property of the text display element of the TitleGUI script to MiddleLeft

2) Insert a • at the front of each new line. I know it's a new line because it's either the very first line or the preceding one ending with \n\n

The bullet is ASCII character 149 • and you can copy it from here into the start of your text string(s).

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Formatting bold text in EditorUtility.DisplayDialog 0 Answers

GUILayout.SelectionGrid with GUIStyle ignores textColor 2 Answers

Inserting text into GUILayout Box? 3 Answers

Correctly position GUILayout controls 3 Answers

3D layout group 0 Answers


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