0

I'm just getting back into GameMaker, since it's been a while. Upgraded to Studio 2 since it's all shiny and new and stuff.

My test code is quite simple:

/// @description Update position each step
x = clamp(mouse_x, sprite_width/2, room_width-sprite_width/2);

And it works just fine... provided the mouse is within the game window. As soon as the mouse strays outside, it stops updating. This is kind of a problem if I want to make a basic Breakout-type game, since it's very easy for the mouse to stray up or down during gameplay, and losing just because your mouse clipped the title bar of the window is a bit gutting.

Is there a setting I'm missing somewhere? I'm sure older versions of GameMaker updated mouse_x no matter where the mouse was...

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592

1 Answers1

0

I have never used Studio 2, but you could try keeping the mouse inside the game window like so:

/// @description Update position each step
mouse_x = clamp(mouse_x, sprite_width/2, room_width-sprite_width/2);
x = mouse_x;
Timtech
  • 1,224
  • 2
  • 19
  • 30