Unity C# Script to change text, text Color, text fontSize

preview_player
Показать описание
This tutorial helps you to change the text, the text color, and the text font size, through C# script
Рекомендации по теме
Комментарии
Автор

i was having trouble with my colors, but at 4:57 you said "dont forget to set your alpha to 1" and that was it. thank you for that!!!

Central
Автор

I would put the changes in void Start () rather than Update, so the game doesn't do it every single frame. Running it once is enough.

LawlFrank
Автор

AHHHH thank you so much!!! I've been making a 'Shaun of the Dead' game having taught myself how to code over 4 years and I've been stuck on creating a dialogue system for 3 days until this video! All the other tutorials missed the stuff i needed.

jyedavid
Автор

Easy and quick is better than good. Thank you very much.

davidcanalespaez
Автор

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ChangeText : MonoBehaviour {

public Text myText;
public int newFontSize;
public string newString;
public Color newColor;

//Update is called once per frame
void Update () {
myText.text = newString;
myText.fontSize = newFontSize;
myText.color = newColor;
}
}

FoxGAMING-NTF
Автор

wow. out of everyone on youtube you did this the best!!

omerbaldo
Автор

This will definitely help. But do you know how would I add this to a collection component?
Meaning you collect an object (Item) and it will change the text.

SlasherTheMod
Автор

You are soooo talented (Y) great video

michel
Автор

THANK YOU SO MUCHHH!!! I DON'T KNOW WRITE THE "using UnityEngine.UI;". VERY THANKS!

Rubens
welcome to shbcf.ru