From fc3874657348bde6ce7e3fab625c92dfec91baaa Mon Sep 17 00:00:00 2001 From: Sarah Bradley Date: Sun, 17 Dec 2023 23:31:40 -0800 Subject: Added Window Scaling, custom mouse, and Neko nametags --- Mouse.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Mouse.cs (limited to 'Mouse.cs') diff --git a/Mouse.cs b/Mouse.cs new file mode 100644 index 0000000..bec6eec --- /dev/null +++ b/Mouse.cs @@ -0,0 +1,32 @@ +using System.Numerics; +using OnekoOnline.Net; +using Raylib_cs; + +namespace OnekoOnline; + +class Mouse : Drawable +{ + Texture2D CursorTex = Raylib.LoadTexture("misc/cursor.png"); + + public Mouse() + { + DrawOrder = 100; + Drawables.Add(this); + } + + public override void Update(float delta) + { + Position = Raylib.GetMousePosition()/OnekoOnline.WindowScale; + } + + public override void Draw() + { + if (Raylib.IsCursorOnScreen()) + Raylib.DrawTexture(CursorTex, (int)Position.X, (int)Position.Y, Color.WHITE); + } + + public override void Dispose() + { + Raylib.UnloadTexture(CursorTex); + } +} \ No newline at end of file -- cgit