Added function to enable/disable floating joystick
This commit is contained in:
@@ -594,6 +594,9 @@ int main(int argc, char* argv[])
|
||||
fps = (float)fps_count * 1000.0 / (tick - fps_start);
|
||||
fps_count = 0;
|
||||
fps_start = tick;
|
||||
static int fj = false;
|
||||
fj=!fj;
|
||||
SDL_ANDROID_SetScreenKeyboardFloatingJoystick(fj);
|
||||
}
|
||||
|
||||
print_num(screen, font, screen->w-37, screen->h-12, fps);
|
||||
|
||||
@@ -103,6 +103,10 @@ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEven
|
||||
/* Configure a button to stay pressed after touch, and un-press after second touch, to emulate Ctrl/Alt/Shift keys */
|
||||
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(int buttonId, int stayPressed);
|
||||
|
||||
/* Enable or disable floating joystick, the joystick is hidden after you disable floating joystick,
|
||||
you should set it's coordinates with SDL_ANDROID_SetScreenKeyboardButtonPos(). */
|
||||
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled);
|
||||
|
||||
/* Set screen keyboard transparency, 255 or SDL_ALPHA_OPAQUE is non-transparent, 0 or SDL_ALPHA_TRANSPARENT is transparent */
|
||||
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardTransparency(int alpha);
|
||||
|
||||
|
||||
@@ -1191,6 +1191,14 @@ int SDL_ANDROID_SetScreenKeyboardHintMesage(const char * hint)
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardFloatingJoystick(int enabled)
|
||||
{
|
||||
floatingScreenJoystick = enabled;
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Dumps OpenGL state for debugging - typically every capability set with glEnable().
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user