Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Native mouselock for GameMaker

Constrains the mouse cursor to a rectangle at system level · By YellowAfterlife

Is there any chance YellowAfterLife will make a small guide to this

A topic by Cleanyourroom created Sep 22, 2020 Views: 217 Replies: 1
Viewing posts 1 to 2

As much as I continue to try, the extension doesn't seem to work exactly like I want it. I was wondering if there was a small guide for use. 

Developer

There's a demo project (GMZ) included.

Usually you do

if (window_has_focus()) {
    display_mouse_lock(window_get_x(), window_get_y(), window_get_width(), window_get_height());
} else display_mouse_unlock();

to lock the mouse to window rectangle (and unlock when the game doesn't have focus) and that's it really