Cita de: mrpacogp date=1401949207A mi me encanta.
Aunque no me has preguntado
A mi no me gusta nada
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: mrpacogp date=1401949207A mi me encanta.
Aunque no me has preguntado
public var posicion_x : float;
public var posicion_y : float;
public var size_fuente : float;
function SetPosicion_X (p : float){posicion_x = p;}
function SetPosicion_Y (p : float){posicion_y = p;}
function SetSizeFuente(s : float){size_fuente = s;}
function Awake(){
SituarGUIText();
this.GetComponent(PosicionadorGUIText).enabled = false;
}
function SituarGUIText(){
this.guiText.fontSize = size_fuente * Screen.width;
this.transform.position = Vector3.zero;
this.transform.localScale = Vector3.zero;
this.guiText.pixelOffset.x = posicion_x * Screen.width;
this.guiText.pixelOffset.y = posicion_y * Screen.height;
}
@script ExecuteInEditMode()
@Range(0,1)
public var posicion_x : float;
@Range(0,1)
public var posicion_y : float;
@Range(0,1)
public var size_fuente : float;
private var script_parametros_gui_text : ParametrosGUIText;
function Start(){
script_parametros_gui_text = this.GetComponent(ParametrosGUIText);
}
function Update() {
this.guiText.fontSize = size_fuente * Screen.width;
this.transform.position = Vector3.zero;
this.transform.localScale = Vector3.zero;
this.guiText.pixelOffset.x = posicion_x * Screen.width;
this.guiText.pixelOffset.y = posicion_y * Screen.height;
script_parametros_gui_text.SetPosicion_X(posicion_x);
script_parametros_gui_text.SetPosicion_Y(posicion_y);
script_parametros_gui_text.SetSizeFuente(size_fuente);
}