Description
The MouseVisibility.Hidden
field is a member of the MouseVisibility
enumeration in the Sandbox namespace. It indicates that the mouse cursor is locked to the game window and cannot interact with any UI elements. This is typically used in scenarios where full immersion in the game is desired, and mouse interaction with UI elements is not necessary or should be prevented.
Usage
To use the MouseVisibility.Hidden
field, you can set the mouse visibility state in your game logic to ensure that the mouse is locked to the game window. This is useful in first-person games or other immersive experiences where UI interaction is not required.
Example
// Example of setting the mouse visibility to Hidden
MouseVisibility currentVisibility = MouseVisibility.Hidden;
// Apply the visibility setting to the game
Game.SetMouseVisibility(currentVisibility);