This question was
closed Jan 30, 2019 at 12:19 PM by
el-mas-pro-470 for the following reason:
Do not answered
Question by
el-mas-pro-470 · Jan 29, 2019 at 09:48 PM ·
uitextureworldtoscreenpoint
WorldToScreenPoint texture? help!
Hello! how to change the text in to a custom texture in this script? Thanks!
using UnityEngine;
using System.Collections;
public class Etiqueta : MonoBehaviour {
public string Text;
void Start () {
}
// Update is called once per frame
void OnGUI ()
{
Vector3 PosicionEnPantalla = Camera.main.WorldToScreenPoint(transform.position);
float Escala = PosicionEnPantalla.z /10;
GUIStyle st = new GUIStyle ();
st.fontSize = Mathf.CeilToInt (20/Escala);
st.alignment = TextAnchor.MiddleCenter;
GUI.Label(new Rect (PosicionEnPantalla.x - 70/2/Escala, Screen.height - PosicionEnPantalla.y - 40/Escala, 70/Escala, 20/Escala),(Text), st);
}
}
Comment