Watch
2
0
Fork
You've already forked raylib-cs
0

Create Cursor.cs

This commit is contained in:
Nickolas McDonald 2023-08-20 14:06:39 -04:00
commit 312a851c34

44
Raylib-cs/types/Cursor.cs Normal file
View file

@ -0,0 +1,44 @@

namespace Raylib_cs
{
public readonly struct Cursor
{
/// <summary>{ <see langword="set"/>; }
/// <see langword="true"/> <inheritdoc cref="Raylib.EnableCursor"/>
/// <see langword="false"/> <inheritdoc cref="Raylib.DisableCursor"/></summary>
public bool Enabled
{
set
{
if (value) Raylib.EnableCursor();
else Raylib.DisableCursor();
}
}
/// <summary>{ <see langword="get"/>; }
/// <inheritdoc cref="Raylib.IsCursorHidden"/>,
/// { <see langword="set"/>; }
/// <see langword="true"/> <inheritdoc cref="Raylib.HideCursor"/>
/// <see langword="false"/> <inheritdoc cref="Raylib.ShowCursor"/></summary>
public bool Hidden
{
get => Raylib.IsCursorHidden();
set
{
if (value) Raylib.HideCursor();
else Raylib.ShowCursor();
}
}
/// <summary>{ <see langword="set"/>; }
/// <inheritdoc cref="Raylib.SetMouseCursor"/></summary>
private MouseCursor MouseCursor // Unsure whether this makes sense so leave it disabled for now
{
set => Raylib.SetMouseCursor(value);
}
/// <summary>{ <see langword="get"/>; }
/// <inheritdoc cref="Raylib.IsCursorOnScreen"/></summary>
public bool OnScreen => Raylib.IsCursorOnScreen();
}
}