|
Gama C Library
Gama C API Documentation
|
Defines the theme and functionality for a virtual joystick widget. More...
Go to the source code of this file.
Data Structures | |
| struct | gmwJoystickTheme |
| Structure defining the visual theme for a joystick widget. More... | |
Functions | |
| int | gm_joystick_anim (double x, double y, double radius, gmPos *pos, gmPos *vpos) |
| Creates and renders an animated joystick widget that can be manipulated with the mouse. | |
| int | gmw_joystick (double x, double y, double radius, gmPos *pos) |
| Creates and renders a joystick widget that can be manipulated with the mouse (non-animated version). | |
Variables | |
| gmwJoystickTheme | gmwJoystick |
| Global joystick theme instance with default values. | |
Defines the theme and functionality for a virtual joystick widget.
This file provides structures for customizing the appearance of an on-screen joystick and a function to render an interactive joystick that responds to mouse input, outputting its normalized position.
Creates and renders an animated joystick widget that can be manipulated with the mouse.
This function draws a virtual joystick on screen, tracks mouse interaction, and outputs its normalized logical position. The visual knob position is animated smoothly.
| x | The x-coordinate of the joystick's center. |
| y | The y-coordinate of the joystick's center. |
| radius | The radius of the joystick base circle. |
| pos | Pointer to a gmPos structure to store the joystick's logical position (normalized to -1.0 to 1.0 in X and Y). |
| vpos | Pointer to a gmPos structure for the animated visual knob position. If NULL, pos is used for both logical and visual position. |
| int gmw_joystick | ( | double | x, |
| double | y, | ||
| double | radius, | ||
| gmPos * | pos ) |
Creates and renders a joystick widget that can be manipulated with the mouse (non-animated version).
This is a simplified wrapper around gm_joystick_anim that does not use a separate visual position for animation, making the knob snap to position.
| x | The x-coordinate of the joystick's center. |
| y | The y-coordinate of the joystick's center. |
| radius | The radius of the joystick base. |
| pos | Pointer to a gmPos structure to store the joystick's logical position (normalized to -1.0 to 1.0 in X and Y). |
| gmwJoystickTheme gmwJoystick |
Global joystick theme instance with default values.