From 5ad26364b75354f69dd594ea87b4ee180c514e66 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 15 Jun 2023 00:22:39 +0200 Subject: [PATCH] Added an export to the test project. --- game/Main.tscn | 1 + game/TestSprite.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/game/Main.tscn b/game/Main.tscn index 1c283cf..0b8edbe 100644 --- a/game/Main.tscn +++ b/game/Main.tscn @@ -11,3 +11,4 @@ position = Vector2( 515, 262 ) [node name="TestSprite" type="Sprite" parent="Node2D"] texture = ExtResource( 2 ) script = ExtResource( 1 ) +XScale = 2.0 diff --git a/game/TestSprite.cs b/game/TestSprite.cs index c791166..8bb1390 100644 --- a/game/TestSprite.cs +++ b/game/TestSprite.cs @@ -7,7 +7,10 @@ public class TestSprite : Sprite // private int a = 2; // private string b = "text"; private float dt; - + + [Export] + public float XScale; + // Called when the node enters the scene tree for the first time. public override void _Ready() { @@ -19,7 +22,7 @@ public class TestSprite : Sprite { dt += delta; - Position = new Vector2((float)Math.Sin(dt) * 100, (float)Math.Cos(dt) * 100); + Position = new Vector2((float)Math.Sin(dt) * 100 * XScale, (float)Math.Cos(dt) * 200); //Position += new Vector2(1, 1); } }