Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

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

This should be on the main page :) That's it though - very easy.