u-3300 Text Mesh Pro TMP
Text Mesh Pro is the basic app used ot crete text in Unity Projects.
using TMPro;
public TextMeshProUGUI lbtext;// This is the FIELD NAME, not the actural text
lbtext.text = “lb Title”; // code to change listbox on screen
===================
TMP – TEXT COLOR WILL NOT CHANGE – CHANGED FONT TO
ROBOTO.
— MMAKE SURE YOU HAVE IMPORTED TMP ESSETNIALS
RESOURCES FORM WINDOW -> TMP PRO—
Make sure ALL associated packages are installed from windows\Text Mesh Pro . Text will not display if fonts are not installed, and not message is displayed.
=================================
Steps
Set Game Windoww to desired resolution
– 1920 x 1080
this will be the canvas size.
create canvas
set camvas tp screem camera
– set to camera view
– assign a camera (main camera)
camvas size will correspont to the game window setting.
Open the EventSystem game object
set First Selected to Canvas.
Create pael game object. P0go
Create the panel as child ot P0go.
-resize to fill canvas
– set color
======== TMP BUTTON =================
video tutorial good
——– save ——-
add a button to the TMP canvas
UI -> TMP Button
——– save, return to Unity ——–
.Create name and open new C# script.
– make sure to include: using TMPro;
enter code for the output variable
——– save –return to Unity——
. Create and name new empty.
. Add c# script to the output field –
THIS IS AN OUTPUT FIELD, YOU CANNOT READ IT
in the clicked script section
-drag and drop from UI canvas -Text
to the empty script field
——– save ——-
select the tmp button on the TMP canvas. Connect
in the button clict event add the empty object c# script to the button click event
– press the small + at bottom of click event to add new event.
——– save ——-
——– save ——-