quelques ameliorations de l'ecran de chargements.

This commit is contained in:
osquallo 2018-08-08 11:05:22 +02:00
parent a9ed135b1b
commit a26f5fafc6
6 changed files with 12 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -1194,7 +1194,6 @@ _sections_unfolded = [ "Transform" ]
[node name="CubeShaderTest" parent="World" index="7" instance=ExtResource( 8 )]
editor/display_folded = true
transform = Transform( -0.471909, 0, -0.881647, 0, 1, 0, 0.881647, 0, -0.471909, 4, 2, 3.11353 )
friction = 0.2
bounce = 0.75

View file

@ -2,7 +2,7 @@
[ext_resource path="res://scenes/Main.gd" type="Script" id=1]
[ext_resource path="res://login_scene/login_scene.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/GUI/loading_screens/new_loading_bg_test.tga" type="Texture" id=3]
[ext_resource path="res://assets/GUI/loading_screens/new_loading_bg_1.tga" type="Texture" id=3]
[node name="Main" type="Node" index="0"]
@ -13,7 +13,6 @@ _sections_unfolded = [ "Pause" ]
[node name="background_loader" type="Panel" parent="." index="1"]
visible = false
self_modulate = Color( 0, 0, 0, 1 )
anchor_left = 0.0
anchor_top = 0.0
@ -57,7 +56,7 @@ size_flags_horizontal = 5
size_flags_vertical = 5
texture = ExtResource( 3 )
expand = true
stretch_mode = 7
stretch_mode = 6
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="progress_bar" type="ProgressBar" parent="background_loader/center_container" index="1"]
@ -79,11 +78,11 @@ size_flags_horizontal = 6
size_flags_vertical = 10
min_value = 0.0
max_value = 100.0
step = 1.0
step = 0.1
page = 0.0
value = 0.0
exp_edit = false
rounded = true
rounded = false
percent_visible = true
_sections_unfolded = [ "Margin", "Rect", "Size Flags" ]

View file

@ -55,14 +55,17 @@ func _process(time):
# poll your loader
var err = loader.poll()
update_progress()
if err == ERR_FILE_EOF: # load finished
# update_progress()
var resource = loader.get_resource()
loader = null
set_new_scene( resource )
break
elif err == OK:
update_progress()
# update_progress()
pass
else: # error during loading
show_error()
loader = null
@ -70,9 +73,11 @@ func _process(time):
func update_progress():
print("test: "+str(loader.get_stage())+" / "+str(loader.get_stage_count()) )
var progress = int( (float(loader.get_stage()) / loader.get_stage_count()) *100 )
var progress_bar = get_tree().get_root().get_node("Main/background_loader/center_container/progress_bar")
var progress = (float(loader.get_stage()) / loader.get_stage_count()) * progress_bar.max_value
# update your progress bar?
get_tree().get_root().get_node("Main/background_loader/center_container/progress_bar").value = progress
progress_bar.value = progress
# or update a progress animation?