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 TrollHachem · Dec 29, 2014 at 03:17 PM · uitextnew ui

Fall down a line in Unity 4.6 text via script

Hello , Is there anyway to make the text go one line down in Unity 4.6's text component? using \n didn't work. Thanks

Comment
Add comment · Show 9
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 martin101 · Dec 29, 2014 at 03:31 PM 0
Share

depends on what you are trying to achieve I am assu$$anonymous$$g that you are trying to write something in the text box and pressing enter to get next text in new line.

You can use multiple Text under one panel and have each Text represent one line

$$anonymous$$ay be you can post a screenshot of what you want and we may be clear about it

avatar image TrollHachem · Dec 29, 2014 at 04:26 PM 0
Share

alt text

This is what i'm trying to achieve , the problem is that i want to only have 1 text box because each item will have a different description and thus different number of lines. Thanks.

detailbox.png (8.8 kB)
avatar image Mmmpies · Dec 29, 2014 at 09:41 PM 0
Share

Are you wanting a way to show the Uses: items one after another?

Are they stored in some sort of list or array?

avatar image TrollHachem · Dec 29, 2014 at 09:52 PM 0
Share

An item is a scriptable object from the main class Item that has as children ItemConsumable etc... , Anyway , a Detail box has a script that when you pass an Item to it , it fills in those bars (title,type,description,volume and mass) , by passing "\n" in the description as a "go down one line" , it doesn't work.

avatar image TrollHachem · Dec 29, 2014 at 09:53 PM 0
Share

Backslash N* it doesn't display it in the comment

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Swati Patel · Jan 30, 2015 at 09:58 PM

I have also faced same problem regarding newline character(\n) but I have solved it. Instead of double quotes, pass \n in single quote like '\n'.

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
avatar image
0

Answer by jgodfrey · Dec 29, 2014 at 11:23 PM

I'm not currently using 4.6 so I've never tried this, but...

According to the docs, the Text object has a "supportRichText" boolean property. If you set that to true, I'd expect some form of a new line escape sequence to be supported. So, either backslash-n, or backslash-r backslash-n, or even Environment.NewLine

Jeff

Comment
Add comment · Show 1 · 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
avatar image TrollHachem · Dec 29, 2014 at 11:41 PM 0
Share

Well , Rich editing is for layout , Currently , i only can copy from an already written text :/

avatar image
0

Answer by Mmmpies · Dec 30, 2014 at 08:59 AM

OK, I really think you'd be better having those items just as boolean values in your scriptable objects.

This will allow you to compare if that task or item increases a certain skill. It'll also allow you to run through the list of all items and compare that to the current item. If the item is wood, as in your example, then when it gets to Crafting it finds that it equals true, then it instantiates a prefab text with Text.text = " - " + SkillName.ToString();

EDIT: Ha - just got a text updating this as I add it!

If you have lots of skill type values then bool may not be viable but what's the maximum number of skill tags any one item cna have? You could have an Enum for you skill sets and then have say 5 slots available to add up to 5 skill type to each scriptable object.

Comment
Add comment · Show 1 · 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
avatar image TrollHachem · Dec 30, 2014 at 11:10 AM 0
Share

There'll be hundreds of items and probably tens of types... I'll just settle with copying from an already written text.

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

30 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 avatar image avatar image avatar image avatar image avatar image avatar image 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

GUIText Help 1 Answer

uGUI letter spacing and kerning 1 Answer

load line from a text file and separate it 4 Answers

How to turn on text in trigger zone 2 Answers

Multiple Text of canvas with One script ?? 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