diff options
| author | Sarah Bradley <git@sarahduck.ca> | 2023-12-17 23:31:40 -0800 |
|---|---|---|
| committer | Sarah Bradley <git@sarahduck.ca> | 2023-12-17 23:31:40 -0800 |
| commit | fc3874657348bde6ce7e3fab625c92dfec91baaa (patch) | |
| tree | 63ddf1864d5c2fb82be156621c6a7225819ef233 /Mouse.cs | |
| parent | 217c93639fc6dee3222e0a3724dd5ed67b34f412 (diff) | |
Added Window Scaling, custom mouse, and Neko nametags
Diffstat (limited to 'Mouse.cs')
| -rw-r--r-- | Mouse.cs | 32 |
1 files changed, 32 insertions, 0 deletions
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 |
