You might notice on emulators and some games that use mouse movement, that the mouse is locked into the window or play area. The movement while contrained within the game window but the movement is able to continue infinitely in any direction.
You can then usually press a predefined key combo to free it from the application window so that items on the desktop can be accessed again.
Your player will get annoyed after a while and give the game away.
Orx lets you perform mouse grabbing and mouse releasing.
Let's try this out on a standard project. First, make your project.
To help you work through this tutorial, first create a new blank project using the init script.
To demo this feature, we will change it from full screen to a smaller window, and make key presses that both grab and release the mouse.
First, change the config to make the full screen into a window, change the Decorations property under the [Display] section:
[Display] ... Decoration = false
Then specify a screen size. The entire [Display] section should look like this:
[Display] Title = mousegrab FullScreen = false Decoration = true Smoothing = true VSync = true ScreenWidth = 800 ScreenHeight = 600
Compile and run. You'll see a demo application with the spinning Orx logo in a window.
Let's set up rotation of the Orx Logo based on the movement of the mouse.
We can do this with a couple of commands in