However, I also need to set IsUiProcessor = true for the EventHandler, and once I do this, ALL input (save for mouse movement, for some reason) is blocked. I can't even enter the menu or console
So, the question is, how can I get the mouse cursor on screen and not block any input (save for the mouse movement, I guess)?
Code: Select all
//registered in MapInfo/GameInfo
Class HG_InputHandlerUI : EventHandler
{
Vector2 cursorPos;
override void OnRegister()
{
self.IsUiProcessor = true;
//self.RequireMouse = true;//this shows the menu-style cursor, which I don't want. I'd rather draw the cursor in the StatusBar script and position it according to the cursorPos values.
}
override bool UiProcess(UiEvent e)
{
if(e.Type == UiEvent.Type_MouseMove)
{
cursorPos.x = clamp(e.MouseX, 0, Screen.GetWidth());
cursorPos.y = clamp(e.MouseY, 0, Screen.GetHeight());
}
return false;
}
}
