Skip to content
Snippets Groups Projects
Commit 65070908 authored by SCHIEBER MORGANE's avatar SCHIEBER MORGANE :fries:
Browse files

#111 - loadingScreen's workinggit add loadingScreen/loadingScreen.gd test/game.*!

parent b939a162
Branches
Tags
No related merge requests found
...@@ -18,9 +18,9 @@ var ratioPanel = float(425)/float(1014) ...@@ -18,9 +18,9 @@ var ratioPanel = float(425)/float(1014)
func _ready(): func _ready():
LOGO = $Control/MarginContainer/VBoxContainer/MusicArena LOGO = $MarginContainer/VBoxContainer/MusicArena
PANEL = $Control/MarginContainer/VBoxContainer/Panel PANEL = $MarginContainer/VBoxContainer/Panel
ROOT = $Control #ROOT = $Control
xWindow = get_viewport().size.x xWindow = get_viewport().size.x
yWindow = get_viewport().size.y yWindow = get_viewport().size.y
...@@ -34,9 +34,9 @@ func _ready(): ...@@ -34,9 +34,9 @@ func _ready():
PANEL.set_custom_minimum_size(Vector2(xPanel,50)) PANEL.set_custom_minimum_size(Vector2(xPanel,50))
var error = get_tree().get_root().connect("size_changed", self, "myfunc") var error = get_tree().get_root().connect("size_changed", self, "myfunc")
yield(gamestate, "gameFullyLoaded") #yield(gamestate, "gameFullyLoaded")
print("gameFullyLoaded") #print("gameFullyLoaded")
ROOT.visible = false #ROOT.visible = false
func myfunc(): func myfunc():
LOGO = $MarginContainer/VBoxContainer/MusicArena LOGO = $MarginContainer/VBoxContainer/MusicArena
......
...@@ -37,6 +37,7 @@ var itemsType = ["beer","hot_dog"] ...@@ -37,6 +37,7 @@ var itemsType = ["beer","hot_dog"]
# Initialize the game scene, players, camera and display # Initialize the game scene, players, camera and display
func _ready(): func _ready():
var player_scene:PackedScene = preload("res://entities/characters/player.tscn") var player_scene:PackedScene = preload("res://entities/characters/player.tscn")
var loadingScreen = $loadingScreen
#Next evey player will spa every other player including the server's own client! Try to move this to server only #Next evey player will spa every other player including the server's own client! Try to move this to server only
for peer_id in gamestate.players: for peer_id in gamestate.players:
...@@ -68,6 +69,7 @@ func _ready(): ...@@ -68,6 +69,7 @@ func _ready():
get_tree().set_pause(true) get_tree().set_pause(true)
print("postpause true") print("postpause true")
yield(gamestate, "gameFullyLoaded") yield(gamestate, "gameFullyLoaded")
loadingScreen.visible = false
print("gameFullyLoaded") print("gameFullyLoaded")
get_tree().set_pause(false) get_tree().set_pause(false)
......
[gd_scene load_steps=6 format=2] [gd_scene load_steps=13 format=2]
[ext_resource path="res://levels/test/game.gd" type="Script" id=1] [ext_resource path="res://levels/test/game.gd" type="Script" id=1]
[ext_resource path="res://levels/hud/hud.tscn" type="PackedScene" id=2] [ext_resource path="res://levels/hud/hud.tscn" type="PackedScene" id=2]
[ext_resource path="res://levels/commons/themes/labelSkillFont.tres" type="Theme" id=3]
[ext_resource path="res://levels/test/Map.tscn" type="PackedScene" id=4] [ext_resource path="res://levels/test/Map.tscn" type="PackedScene" id=4]
[ext_resource path="res://levels/commons/assets/logotmp.png" type="Texture" id=5]
[ext_resource path="res://levels/commons/assets/fondmain.png" type="Texture" id=6]
[ext_resource path="res://levels/commons/themes/panelThemeBlack.tres" type="StyleBox" id=7]
[ext_resource path="res://levels/loadingScreen/loadingScreen.gd" type="Script" id=8]
[ext_resource path="res://levels/loadingScreen/assets/fond2.png" type="Texture" id=9]
[sub_resource type="SpatialMaterial" id=1] [sub_resource type="SpatialMaterial" id=1]
albedo_color = Color( 0.94902, 0.133333, 0.0470588, 0.784314 ) albedo_color = Color( 0.94902, 0.133333, 0.0470588, 0.784314 )
...@@ -16,6 +22,34 @@ distance_fade_mode = 1 ...@@ -16,6 +22,34 @@ distance_fade_mode = 1
distance_fade_min_distance = 0.0 distance_fade_min_distance = 0.0
distance_fade_max_distance = 10.0 distance_fade_max_distance = 10.0
[sub_resource type="Animation" id=3]
length = 5.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:rect_scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.5, 0.7, 0.9, 1.8, 2, 2.2, 3.2, 3.4, 3.6, 4.4, 4.6, 4.8 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ), Vector2( 0.99, 0.99 ), Vector2( 1, 1 ), Vector2( 1, 1 ), Vector2( 0.99, 0.99 ), Vector2( 1, 1 ), Vector2( 1, 1 ), Vector2( 0.99, 0.99 ), Vector2( 1, 1 ), Vector2( 1, 1 ), Vector2( 0.99, 0.99 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:rect_rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 2.3, 5 ),
"transitions": PoolRealArray( 0.34151, 4.59479, 0.34151 ),
"update": 0,
"values": [ 0.0, 5.0, 0.0 ]
}
[node name="game" type="Spatial"] [node name="game" type="Spatial"]
script = ExtResource( 1 ) script = ExtResource( 1 )
...@@ -41,3 +75,122 @@ depth = 59.7284 ...@@ -41,3 +75,122 @@ depth = 59.7284
material = SubResource( 2 ) material = SubResource( 2 )
[node name="itemCollection" type="Spatial" parent="."] [node name="itemCollection" type="Spatial" parent="."]
[node name="loadingScreen" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 8 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect3" type="TextureRect" parent="loadingScreen"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 576.0
margin_bottom = 1000.0
texture = ExtResource( 6 )
stretch_mode = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="loadingScreen"]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 9 )
expand = true
stretch_mode = 7
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="loadingScreen"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 300
custom_constants/margin_left = 300
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="loadingScreen/MarginContainer"]
margin_left = 300.0
margin_right = 724.0
margin_bottom = 600.0
[node name="MarginContainer2" type="MarginContainer" parent="loadingScreen/MarginContainer/VBoxContainer"]
margin_right = 424.0
margin_bottom = 50.0
size_flags_horizontal = 3
custom_constants/margin_top = 50
[node name="MusicArena" type="TextureRect" parent="loadingScreen/MarginContainer/VBoxContainer"]
margin_top = 54.0
margin_right = 424.0
margin_bottom = 54.0
rect_pivot_offset = Vector2( 175.725, -12.5801 )
rect_clip_content = true
texture = ExtResource( 5 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="title" type="AnimationPlayer" parent="loadingScreen/MarginContainer/VBoxContainer/MusicArena"]
autoplay = "title"
anims/title = SubResource( 3 )
[node name="MarginContainer3" type="MarginContainer" parent="loadingScreen/MarginContainer/VBoxContainer"]
margin_top = 58.0
margin_right = 424.0
margin_bottom = 108.0
size_flags_horizontal = 3
custom_constants/margin_top = 50
[node name="Panel" type="Panel" parent="loadingScreen/MarginContainer/VBoxContainer"]
margin_left = 212.0
margin_top = 112.0
margin_right = 212.0
margin_bottom = 162.0
rect_min_size = Vector2( 0, 50 )
size_flags_horizontal = 4
size_flags_vertical = 4
custom_styles/panel = ExtResource( 7 )
[node name="MarginContainer" type="MarginContainer" parent="loadingScreen/MarginContainer/VBoxContainer/Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 10
custom_constants/margin_top = 10
custom_constants/margin_left = 10
custom_constants/margin_bottom = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="loadingScreen/MarginContainer/VBoxContainer/Panel/MarginContainer"]
margin_left = 10.0
margin_top = 16.0
margin_right = 219.0
margin_bottom = 34.0
size_flags_vertical = 6
theme = ExtResource( 3 )
custom_styles/normal = ExtResource( 7 )
text = "your game is loading..."
align = 1
valign = 1
uppercase = true
[node name="MarginContainer" type="MarginContainer" parent="loadingScreen/MarginContainer/VBoxContainer"]
margin_top = 166.0
margin_right = 424.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_top = 290
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment