A WIP automation game
1using System.Numerics;
2using Raylib_cs;
3
4namespace Electropunk.UI;
5
6/* Jim was drawn by Collie as a joke on the Wand.png
7 texture. I decided it make it a UI element because it's
8 silly. */
9public class UIJim(UINode? parent = null) : UINode(0, 0, parent)
10{
11 private static readonly Texture2D Jim = Raylib.LoadTexture("Assets/UI/jim.png");
12
13 private int i = 0;
14 private Vector2 pos = Vector2.Zero;
15
16 public override void Update()
17 {
18 pos = Vector2.Lerp(pos, Raylib.GetMousePosition(), 0.2f);
19
20 base.Update();
21 }
22
23 public override void Render()
24 {
25 Raylib.DrawTexturePro(Jim, new(0, 0, Jim.Width, Jim.Height), new(pos.X, pos.Y, Jim.Width * 2, Jim.Height * 2), new(Jim.Width, Jim.Height), i++, Color.White);
26
27 base.Render();
28 }
29}