From d140e8d0db2759c3c25f9df2cf64fb8c5ddfce01 Mon Sep 17 00:00:00 2001 From: Linus Vogel Date: Fri, 12 Dec 2025 01:14:28 +0100 Subject: [PATCH] fix --- MainScript.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MainScript.cs b/MainScript.cs index cbe78b7..ef9aa99 100644 --- a/MainScript.cs +++ b/MainScript.cs @@ -15,6 +15,7 @@ public partial class MainScript : Node2D private Dictionary _stars = new Dictionary(); private List _scenes = new List(); + private Sprite2D _background = null; // Called when the node enters the scene tree for the first time. public override void _Ready() @@ -78,6 +79,13 @@ public partial class MainScript : Node2D this._stars.Clear(); + Image bgImage = Image.LoadFromFile("resources/" + obj_conf.background); + ImageTexture bgTexture = ImageTexture.CreateFromImage(bgImage); + this._background = new Sprite2D(); + this._background.SetTexture(bgTexture); + projection.AddChild(this._background); + this._background.ZIndex = 4; + foreach (StarConfig star_config in obj_conf.stars) { Sprite2D sprite = new Sprite2D(); @@ -105,6 +113,8 @@ public partial class MainScript : Node2D child.QueueFree(); } + + foreach (KeyValuePair star in this._stars) { projection.AddChild(star.Value.Sprite);