Skip to content

Commit 7859a48

Browse files
committed
feat(testing): test lineinput modifications
1 parent 02db822 commit 7859a48

1 file changed

Lines changed: 4 additions & 41 deletions

File tree

Testing/MyScene.cs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,7 @@ public class MyScene : Scene
1616

1717
public MyScene()
1818
{
19-
var parent = new Entity();
20-
parent.AddComponent(new TransformComponent(new Vec2(100, 200)));
21-
parent.AddComponent(new SpriteSheetComponent("portal", new Vec2(100), [
22-
new("animation", Enumerable.Range(0, 10).Select(x => Convert.ToUInt32(x)).ToList(), 0.2f, true)
23-
], "animation"));
24-
AddEntity(parent);
25-
26-
var movable = new Entity();
27-
movable.AddComponent(new TransformComponent(new Vec2(100)));
28-
movable.AddComponent(new SpriteSheetComponent("portal", new Vec2(100), [
29-
new("animation", Enumerable.Range(0, 10).Select(x => Convert.ToUInt32(x)).ToList(), 0.2f, false)
30-
], "animation"));
31-
movable.AddComponent(new ControlComponent());
32-
parent.AddChild(movable);
33-
34-
var entity = new Entity();
35-
entity.AddComponent(new TransformComponent(new Vec2(300)));
36-
_sprite = entity.AddComponent(new SpriteSheetComponent("portal", new Vec2(100), [
37-
new("animation", Enumerable.Range(0, 10).Select(x => Convert.ToUInt32(x)).ToList(), 0.2f, false)
38-
], "animation"));
39-
_sprite.AnimationEnded += (_, _) => Console.WriteLine($"Animation Ended : {_sprite.Anim}");
40-
_text = entity.AddComponent(new TextComponent("0", offset: new Vec2(0, 50), fontSize: 25));
41-
movable.AddChild(entity);
42-
43-
var button = new Button(
44-
new Vec2(100, 100),
45-
"Hello World",
46-
"RAYLIB_DEFAULT",
47-
new Vec2(200, 50),
48-
Color.White,
49-
Color.Blue,
50-
20
51-
);
52-
53-
button.Clicked += (_, _) => Console.WriteLine("Button Clicked");
54-
55-
AddWidget(button);
19+
AddWidget(new LineInput(new Vec2(500), font: "RAYLIB_DEFAULT", fontSize: 25));
5620
}
5721

5822
public override void Update(float deltaTime)
@@ -61,13 +25,12 @@ public override void Update(float deltaTime)
6125

6226
if (InputManager.IsKeyPressed(Key.A))
6327
{
64-
Widgets[^1].Displayed = false;
28+
DebugManager.Log(LogLevel.LogInfo, ((LineInput)Widgets[0]).Text);
6529
}
30+
6631
if(InputManager.IsKeyPressed(Key.Z))
6732
{
68-
_sprite.Replay();
33+
((LineInput)Widgets[0]).Secret = !((LineInput)Widgets[0]).Secret;
6934
}
70-
71-
_text.Text = _sprite.CurrentImage.ToString();
7235
}
7336
}

0 commit comments

Comments
 (0)