developpement d'écran de chargement et d'écran de sélection de niveau
* modification de certains assets * optimisation de chunks * ajout d'un SceneManager * ajout d'un premier dialogue avec Demeter * changement des jour en charge * mise en place d'un système de run * etc...
This commit is contained in:
32
gui/loading_screen/scripts/loading_screen.gd
Normal file
32
gui/loading_screen/scripts/loading_screen.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
extends CanvasLayer
|
||||
|
||||
const LOADING_BAR_UPDATE_TIME := 0.2
|
||||
|
||||
var loading_value = 0.
|
||||
var loading_text = "" :
|
||||
set(v):
|
||||
%LoadingText.text = v
|
||||
loading_text = v
|
||||
|
||||
func _ready():
|
||||
%LoadingInterface.visible = false
|
||||
|
||||
func show_loading_screen(animation := true):
|
||||
%LoadingProgressBar.value = 0.
|
||||
if animation:
|
||||
await %LoadingAnimation.fade_in()
|
||||
else :
|
||||
%LoadingInterface.visible = true
|
||||
|
||||
func hide_loading_screen(animation := true):
|
||||
if animation and is_node_ready():
|
||||
if %LoadingAnimation.on_animation:
|
||||
await %LoadingAnimation.animation_ended
|
||||
await %LoadingAnimation.fade_out()
|
||||
else : %LoadingInterface.visible = false
|
||||
loading_value = 0.
|
||||
%LoadingProgressBar.value = 0
|
||||
|
||||
func _process(_d):
|
||||
if %LoadingInterface.visible:
|
||||
%LoadingProgressBar.value = lerp(%LoadingProgressBar.value, loading_value * 100, 0.1)
|
||||
1
gui/loading_screen/scripts/loading_screen.gd.uid
Normal file
1
gui/loading_screen/scripts/loading_screen.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c41axxu2t3a8a
|
||||
Reference in New Issue
Block a user