Widgets
Joystick
The joystick widget is interactive controller that allows users to input directional movement, commonly used in games for character or camera control. The configuration is at gmwJoystick, see gmwjoystickTheme.
You draw a joystick with gmw_joystick and provides the X and Y position values of the joystick knob.
For animated joysticks with smooth transitions, you can use gmw_joystick_anim which takes additional parameters for animation state.
Example
Configuration
The joystick appearance and behavior can be customized through the gmwJoystick global variable:
Tips
- The joystick position values range from -1 to 1 in both X and Y directions
- Use the return value to determine if the joystick is currently being manipulated
- The third parameter of
gmw_joystickcontrols the size of the joystick area
