Versions: GameMaker Studio 2.3+
Platforms: Windows [x86, x64], Windows (YYC) [x86, x64]
Links: itch.io page (demo, pre-2.3 versions)
Native mouselock for GameMaker. Perfect for games with screen-space mouse aiming - no more need to worry about the game not restricting the mouse position quickly enough and user clicking outside the window - with this extension the mouse cannot escape the specified region, as it uses OS-level functionality to confine it.
Included functions:
Package contents:
Sample code:
// to be placed in Step event
if (window_has_focus()) {
display_mouse_lock(window_get_x(), window_get_y(), window_get_width(), window_get_height());
} else display_mouse_unlock();
End User Licence Agreement (EULA).