made a dedicated scene for simple on-screen tutorials
This commit is contained in:
37
scenes/tuto_trigger/tuto_trigger.gd
Normal file
37
scenes/tuto_trigger/tuto_trigger.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
extends Area3D
|
||||
|
||||
@onready var control: Control = $Control
|
||||
|
||||
@onready var multiple_inputs_container: HBoxContainer = %MultipleInputsContainer
|
||||
@onready var first_input: TextureRect = %FirstInput
|
||||
@onready var complex_input_label: Label = %ComplexInputLabel
|
||||
@onready var second_input: TextureRect = %SecondInput
|
||||
@onready var tuto_label: Label = %TutoText
|
||||
|
||||
|
||||
@export var first_input_texture: CompressedTexture2D
|
||||
@export var second_input_texture: CompressedTexture2D
|
||||
@export var complex_input_text: String
|
||||
@export var tuto_text: String
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
tuto_label.text = tuto_text
|
||||
first_input.texture = first_input_texture
|
||||
second_input.texture = second_input_texture
|
||||
complex_input_label.text = complex_input_text
|
||||
|
||||
if second_input_texture != null:
|
||||
complex_input_label.text = "+"
|
||||
|
||||
if second_input_texture == null and complex_input_text.is_empty():
|
||||
complex_input_label.visible = false
|
||||
second_input.visible = false
|
||||
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
control.visible = true
|
||||
|
||||
|
||||
func _on_body_exited(body: Node3D) -> void:
|
||||
control.visible = false
|
||||
Reference in New Issue
Block a user