Adding a prefab for the load screen

This commit is contained in:
Anonymus Raccoon
2020-04-15 13:46:05 +02:00
parent 101db4d57b
commit 205f0c590f
4 changed files with 18 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
<gc_entities>
<gc_entity>
<transform_component>
<Size x="800" y="600" />
</transform_component>
<renderer src="loading">
<Rect height="auto" width="auto" top="0" left="0" />
</renderer>
<fixed_to_cam x="50%" y="50%" width="100%" height="100%" />
</gc_entity>
</gc_entities>
+1
View File
@@ -2,6 +2,7 @@
<data>
<sprite name="panel" src="assets/ui/panel.png" />
<sprite name="button_background" src="assets/ui/button_background.png" />
<sprite name="loading" src="assets/ui/panel.png" />
<font src="assets/fonts/roboto.ttf" />
</data>
<gc_entities>
+5 -1
View File
@@ -15,7 +15,11 @@
bool start_button(gc_engine *engine, gc_entity *entity, gc_vector2 _, \
enum gc_mousekeys __)
{
gc_scene *scene = scene_create(engine, "prefabs/game.gcprefab");
gc_scene *scene;
prefab_load(engine, "prefabs/loading.gcprefab");
engine->game_loop(engine, 0);
scene = scene_create(engine, "prefabs/game.gcprefab");
if (!scene) {
engine->should_close = true;
my_printf("The game scene couldn't be loaded.\n");