martes, 15 de octubre de 2024

GDScript para manipular textos de titulos de videojuego en Godot 4.3 3d; dos ejemplos;

 extends Label



# Called when the node enters the scene tree for the first time.

func _ready() -> void:

pass # Replace with function body.



# Called every frame. 'delta' is the elapsed time since the previous frame.

func _process(delta: float) -> void:

if Input.is_action_just_pressed("escapedesalir"):

#rotation_degrees += 180

scale.x = 0

scale.y = 0

-----------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------

Este GDScript de arriba solo escala el texto asta 0 lo hace desaparecer de pantalla.

En el texto solo dice: VER INTRUCIONES "ESC" SALIR INSTRUCCIONES "ESC"

Este texto sale nada mas empezar el juego........... paso al segundo GDScript.........

---------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

extends Label



# Called when the node enters the scene tree for the first time.

func _ready() -> void:

pass # Replace with function body.



# Called every frame. 'delta' is the elapsed time since the previous frame.

func _process(delta: float) -> void:

if Input.is_action_just_pressed("escapedesalir"):

rotation_degrees += 180




--------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------

Este GDScript solamente  rota el texto 180 grados y dice:  

      MOVER NIÑO -"W"-"A"-"S"-"D" --SALTAR "ESPACIO"- "BOTON DEL RATON IZQUIERDO"-¡¡NIÑO MUERDE!!  Y GIRA IZQUIERDA CAMARA ,"BOTON DERECHO"¡¡NIÑO 

       MUERDE!!  Y  GIRA DERECHA CAMARA ,


         "RUEDA DEL RATON"  HACERCA ALEJA CAMARA.

         MOVER LA CAMARA -

        "U"-IZQUIERDA

         "I"DERECHA-

         " J"-ADELANTE-

         "K"-ATRAS-

          INCLINACION DE CAMARA-"O"-"P"

VER INTRUCIONES "ESC" SALIR INSTRUCCIONES "ESC"


Si te fijas veras que estas constantemente abisado para poder ver las instrucciones sin que te moleste el texto en pantalla, y poder jugar con toda la pantalla libre






No hay comentarios:

Publicar un comentario