ajout des graines procédurales et des cinamatiques
This commit is contained in:
30
gui/game/tutorial/step_gui/scripts/step_gui.gd
Normal file
30
gui/game/tutorial/step_gui/scripts/step_gui.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
@tool
|
||||
extends HBoxContainer
|
||||
class_name TutorialStepGui
|
||||
|
||||
const DEFAULT_ICON = preload("res://common/icons/circle-dotted.svg")
|
||||
const SUCEEDED_ICON = preload("res://common/icons/circle-check.svg")
|
||||
const SUCEEDED_OPACITY = 0.5
|
||||
|
||||
@export var suceeded := false : set = set_suceeded
|
||||
@export var text := "" : set = set_text
|
||||
|
||||
func _ready():
|
||||
update()
|
||||
|
||||
|
||||
func set_suceeded(v := suceeded):
|
||||
suceeded = v
|
||||
if is_node_ready():
|
||||
update()
|
||||
|
||||
|
||||
func set_text(v := text):
|
||||
text = v
|
||||
if is_node_ready():
|
||||
update()
|
||||
|
||||
func update():
|
||||
%Icon.texture = SUCEEDED_ICON if suceeded else DEFAULT_ICON
|
||||
%Label.text = tr(text)
|
||||
modulate.a = SUCEEDED_OPACITY if suceeded else 1.
|
||||
1
gui/game/tutorial/step_gui/scripts/step_gui.gd.uid
Normal file
1
gui/game/tutorial/step_gui/scripts/step_gui.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c2w7h0x2blimk
|
||||
40
gui/game/tutorial/step_gui/step_gui.tscn
Normal file
40
gui/game/tutorial/step_gui/step_gui.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene format=3 uid="uid://cnh1uof0w06f4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c2w7h0x2blimk" path="res://gui/game/tutorial/step_gui/scripts/step_gui.gd" id="1_8qp12"]
|
||||
[ext_resource type="Texture2D" uid="uid://dk7j4cmn2avor" path="res://common/icons/circle-check.svg" id="2_8qp12"]
|
||||
|
||||
[node name="Step" type="HBoxContainer" unique_id=595946430]
|
||||
modulate = Color(1, 1, 1, 0.5)
|
||||
custom_minimum_size = Vector2(400, 0)
|
||||
offset_right = 24.0
|
||||
offset_bottom = 20.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
alignment = 1
|
||||
script = ExtResource("1_8qp12")
|
||||
suceeded = true
|
||||
text = "Hello"
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="." unique_id=1345441660]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource("2_8qp12")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="RichTextLabel" parent="." unique_id=1116828300]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
theme_override_font_sizes/normal_font_size = 15
|
||||
theme_override_font_sizes/bold_font_size = 15
|
||||
theme_override_font_sizes/bold_italics_font_size = 15
|
||||
theme_override_font_sizes/italics_font_size = 15
|
||||
theme_override_font_sizes/mono_font_size = 15
|
||||
bbcode_enabled = true
|
||||
text = "Lorem Ipsum dolor sit amet and again and again and again and again"
|
||||
fit_content = true
|
||||
Reference in New Issue
Block a user