CustomUpdate
Introduction
When is CustomUpdate used?
CustomUpdate replaces regular update logic
Code Example
// In CustomInitialize or your Game's Initialize:
GuiManager.Cursor.CustomUpdate = HandleCursorUpdate;
// Then define HandleCursorUpdate:
void HandleCursorUpdate(Cursor cursor)
{
Keyboard keyboard = InputManager.Keyboard;
if (keyboard.KeyDown(Keys.Up))
{
cursor.ScreenY--;
}
if (keyboard.KeyDown(Keys.Down))
{
cursor.ScreenY++;
}
if (keyboard.KeyDown(Keys.Right))
{
cursor.ScreenX++;
}
if (keyboard.KeyDown(Keys.Left))
{
cursor.ScreenX--;
}
if (keyboard.KeyDown(Keys.Space))
{
cursor.PrimaryDown = true;
}
}Last updated
Was this helpful?