How to create simple UI text after deleting TextMeshPro in Unity - unity3d

I just deleted the TextMeshPro package and I don't know where to create a simple UI text now.
It doesn't show it for me anymore.

I assume that you are talking about TextMeshPro?
Usually if you right click in the hierarchy, you will find stuff as text elements under UI. If you have TextMeshPro installed you still can find regular Button, Text, Input etc. elements under UI > Legacy.

Related

How to make a GameObject that prompts user for text input in Unity

I'm new to Unity and I'm trying to create an object that upon being placed by the user will prompt the user for text input.
The GameObject is basically a text box. This is also meant for a mobile application.
Fortunately, the answer is very simple and doesn't even require writing code.
You can use the “InputField" UI component.
You can quickly create an InputField from the menu bar entry "GameObject> UI> InputField" or "GameObject> UI> Legacy> InputField>".
This way, if you didn't already have a canvas in the scene, it will be created, and an InputField will be inserted inside.
The parent gameObject manages the inputField, and in fact it is the only one with the component, while the child objects are to show the text, "placeholder" for the text before inserting some text, and "text" to show the text it will write the user.
if you think my answer helped you, you can mark it as accepted and vote positively. I would very much appreciate it :)

Unity Dropdown shows the first time around, duplicated text

I am having this issue where I have a dropdown that should say finances, inventory, and stats. Which when you click on it will cause other panels of UI to appear. Now for some reason, the options it says it has is all Money:(which is the first item name of the first option). Why is that? I've attached images below that show what I mean.
Sorry about the links i dont have high enough rep yet
Duplicated Text of Money
Another instance of ^
My Tabs
Dropdown Setup
Let's take a closer look at your third and fourth pictures and compare them to the default Dropdown UI element.
So in your third image you show a similar tree but what happened to the Template GameObject? It appears you deleted this and replaced it with the Finances GameObject. This is your primary issue. You can't delete this Template GameObject portion of the Dropdown GameObject. The Template is utilized by the Dropdown code in order to further determine the style of the Dropdown you'll see while in game as well as provide you with a template to look at. I don't know all of the internals of how this works, but I know it for sure plays a roll in your issue.
I know this because now take a look at my Dropdown component. Look at the Template field in mine and compare it to yours. Your's is filled with Finances rather than Template, which is the reason that your Dropdown populates with fields from the Finances rather than the values you are trying to pass it.
Here is what I suggest you do. I'm assuming that the FinancesTab, InventoryTab and StatsTab are all UI elements you want to open upon clicking the respective Dropdown item. If that is the case:
Create a new Dropdown GameObject
Don't delete the Template GameObject within it and leave the Template field in the Dropdown GameObject as is
Add a script that utilizes the SetActive function for each UI element (place them in public fields) to the Dropdown GameObject
Set this code up so that when a certain item on the Dropdown is selected, it sets the desired UI Tab to SetActive(true);
Now reference the new script in the OnValueChanged(Int32) field and reference the correct Method from that script in the dropdown menu in the OnValueChanged(Int32) field.
I believe this should solve your problem and help you achieve what you want. Take a look at the Dropdown API and this Youtube tutorial on Dropdowns if my steps are confusing. You can definitely achieve what you want by following those two links (that's how I figured them out!).
Hope this helps!
Your caption is the gameobject 'Label' so its defaulting that in the dropdown because there are no sprites. I'm guessing Label has a text component that says 'Money'?

How to add text outline in unity

How can i add text outline in unity over a text UI object?
I want to do it in the designer/editor view. i cant see to find any useful topic and i also cant see how to add it from the designer view.
My project is 2d and i'm using the latest unity version 5.3. I want to achieve similar effect.
Or. Alternatively to Joe's answer. To simply add a outline effect to a normal .ttf font :
Click on the text object from the Hierarchy
Click the Add Component button in the inspector
Type "outline" in the search bar.
Add the outline component.
Note! This explains how to make custom type ("sprite sheet type") in Unity.
Before reading it, check Uri's & Programmer's answer which explains using the handy new "outline" feature in .UI ! It may well be enough!
Unity does not have any fancy type handling at all.
You can drop in "normal" .ttf fonts,
or, you can drop in "image fonts", called custom fonts by Unity, where you literally make each letter on a sprite sheet.
A font sprite sheet looks something like this:
Here's exactly how to do it ...
(1) you have to use GlyphDesigner (or any similar product) to actually make your custom font sheet. Find the product you like for your Mac or PC to do this.
(2) There is a critical trick.
Unity completely forgot to include a type matcher for custom fonts. (They may fix this in Unity 6.) It's one of the stupidest things in Unity. So, fortunately there is a free and perfect script
BitmapFontImporter.cs
https://github.com/BenoitFreslon/BitmapFontImporter
There's a full and long tutorial link at that page.
You have to include that to make custom fonts work. It's just one of those weird things about Unity.
So in short, firstly you have to literally "draw" such custom fonts, letter by letter. In fact you need to use something like GlyphDesigner to do that.
Secondly in Unity you have to use the extremely handy script mentioned above or it won't work. Enjoy!
http://answers.unity3d.com/answers/1105527/view.html
TextMesh Pro from the Asset Store does the job and it can be imported for free.
This gives plenty of possibilities fort texts, including how thick the outline should be.

Gui text does not display

I am using unity 4.6 to develop a small game.
There is no gui text object in the menu. Therefore I created an empty object and added gui text as a component. But it does not display the text I type. Need help on this. Thank you
I think that 4.6 is when they introduced the new UI system so you can use that.It is actually pretty easy...from the drop down menu that you created the game object go to UI. There you can select from a number UI options one of witch is Text or UI Text if my memory serves me well. When you click it it will create a canvas object and UI Text object that is a child of the Canvas.From here just select the Text object and in the inspector you have a textbox which should serve your need :) Also the Canvas is your screen in the sense that if you drag your text to the top left corner of the Canvas(in the scene view) your text will be in the top left corner of the screen when you start your game(at least in the default settings). Hope that helps!
P.S. Also here is a link to the new UI article that the Unity guys have on their site: https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/the-new-ui
That happens sometimes. Delete the current gameobject and the guitext in the scene. Do what you did backwards.
Create a new guitext then create a new empty gameobject. Change the transform of the empty gameobject to 0,0,0 then drag the new gui text into the empty gameobject.
That should solve your problem.
The default text you should see if that went well is "New Text".
If you are editing the new text in the text area and it stopped showing, you will need to increase the width and sometimes the Height of the guiText. Don't use the scale tool as that will work but the graphics you get will be low quality text rendering on the screen.

How to disable hover effect to highlight menu items in GWT MenuBar?

I am making a vertical Menu using GWT MenuBar and selection of particular MenuItem shows content on the right, I am trying to make something similar to TabPanel, but with Tabs on left instead of being on top. Now, since I've got the Menu items and actions in place, I want to remove the effect of hovering over and changing color, and keep that menu item selected which was clicked last and whose content is loaded on the right.
I am open to any comments, if you have a better solution to implement this, using some other components(with-in) GWT, please drop in a comment with your suggestions, I'll really appreciate that.
Or if you can just tell me how can I disable this effect, of hovering and sticking to only that selection, That would be awesome too..
Thanks to everyone, taking time to read this and suggesting a solution.
It's all defined in the CSS of your GWT's theme (probably the default one), so it's a matter of overriding those styles - make sure it's not the other way around :) Inspect the code with a tool like Firebug to see what's exactly being set and change that.