Mouse and Touch Screen (Cursor)
Introduction
Code Example: Accessing the Cursor
protected override void Update(GameTime gameTime)
{
GumUI.Update(gameTime);
Cursor cursor = GumUI.Cursor;
if(cursor.PrimaryClick)
{
ColoredRectangleRuntime rectangle = new ();
rectangle.AddToRoot();
rectangle.X = cursor.XRespectingGumZoomAndBounds();
rectangle.Y = cursor.YRespectingGumZoomAndBounds();
rectangle.Color = Color.Red;
}
base.Update(gameTime);
}
Cursor clicksChecking Control Over
WindowOver

Disabling the Cursor Globally

DisabledCursor used to prevent UI interactionLast updated
Was this helpful?

