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 99andy · Sep 26, 2013 at 10:43 PM · text mesh

How to edit text

I have a 2D game with some text. After a moment I load a picture on the text. Problem is, I use GUI.Label and the text have more depth than my load picture. I could'n hide the text and show the picture, because I need both at the same time. I could set depth position (the third dimension), but I am not sure, if it is possible for GUI.Label. Is it?

I also have tried 3D Text Mesh, but there I don't know how to set width. I don't want it for full screen, but just for some area. Please, what should I do for solve my problem?

EDIT: Let say, I have a image with a text (the text is in GUI.Label). For example like this: GUI.Label (Rect (25, 25, 100, 30), "Label");

And a background (the background is a texture with texture)

It can look like this: (GUI.Label and a image)

alt text

But my problem is, I need set more depth for my image (GameObject with texture)

But I don't know, if it is possible to set depth for GUI.Label text?

Or, I can do it with a 3D Text Mesh, but I need it in a area. And I don't know, how I can set width for 3D Text Mesh.

My two questions are? 1. How can I set a depth for GUI.Label text? 2. Is it possible to set width for a 3D Text Mesh?

I hope you understand me now.

Comment
Add comment · Show 5
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 Kiloblargh · Sep 26, 2013 at 10:48 PM 0
Share

I don't really know what you're asking here, it's rather incoherent. Post all relevant code and a screenshot and you are more likely to get useful help.

avatar image MrProfessorTroll · Sep 26, 2013 at 11:29 PM 0
Share

I dont understand what your saying. You say that you want a picture in front of your text, but you dont want to remove the text, but the text is covering your picture so you want to temportarily remove it. Is this correct? Do you want your text to be visible while the picture is up?

avatar image highpockets · Sep 27, 2013 at 09:49 AM 0
Share

Just make the text mesh and scale it on the x axis to adjust the width.

You can adjust the scale in the object's transform in the properties panel

avatar image DeveshPandey · Sep 27, 2013 at 11:17 AM 0
Share

@99andy : I guess that, you want to display a text on the image? clarify your need.

avatar image Jamora · Sep 27, 2013 at 12:55 PM 0
Share

GUI elements are drawn in the order they're called in the script.

 GUILayout.Label("I'm hidden");
 GUILayout.Label(texture); //will be drawn on top of the label
 
 GUILayout.Label(texture); //will be drawn behind the label
 GUILayout.Label("I'm on top.");

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Artaani · Sep 27, 2013 at 10:44 AM

You can just setup your texture in GUI Skin or Style, for examle:

 public GUIStyle MyStyle;
 
 void OnGUI () {
     GUI.Label (new Rect (0, 0, 200, 200), "Hello", MyStyle);
 }

Then, in the inspector open MyStyle and set you own texture for normal, hover, active, etc. states.

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

20 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

Related Questions

Fitting a box collider to 3D text perfectly 1 Answer

Text Mesh Pro: highlight all words in a link 0 Answers

How to implement Text Mesh text wrapping? 2 Answers

make line Indicator invisible 1 Answer

Line Break on text mesh not working? 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