Tied in my recent Android flick gesture addition to a Scroll() function. GameState now has a virtual function OnScroll() call that, by default is a no-op; each game state can choose to override how to respond to flick gestures. I've added one such override in the Deck Editor so that a flick up/down acts like the psp button up/down for scrolling between color filters.
This commit is contained in:
+12
-8
@@ -45,6 +45,17 @@ const int kHitzonePliancy = 50;
|
||||
// tick value equates to ms
|
||||
const int kTapEventTimeout = 250;
|
||||
|
||||
|
||||
uint64_t lastTickCount;
|
||||
JGE* g_engine = NULL;
|
||||
JApp* g_app = NULL;
|
||||
JGameLauncher* g_launcher = NULL;
|
||||
|
||||
class SdlApp;
|
||||
|
||||
SdlApp *g_SdlApp = NULL;
|
||||
|
||||
|
||||
class SdlApp
|
||||
{
|
||||
public: /* For easy interfacing with JGE static functions */
|
||||
@@ -215,6 +226,7 @@ public:
|
||||
|
||||
case SDL_JOYBALLMOTION:
|
||||
DebugTrace("Flick gesture detected, x: " << Event->jball.xrel << ", y: " << Event->jball.yrel);
|
||||
g_engine->Scroll(Event->jball.xrel, Event->jball.yrel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -228,14 +240,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
uint64_t lastTickCount;
|
||||
JGE* g_engine = NULL;
|
||||
JApp* g_app = NULL;
|
||||
JGameLauncher* g_launcher = NULL;
|
||||
SdlApp *g_SdlApp = NULL;
|
||||
|
||||
|
||||
|
||||
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
|
||||
{
|
||||
/* windows controls */
|
||||
|
||||
Reference in New Issue
Block a user