Reuse swipe code of Android with Qt, associate "swipe left" to "other cards" in the shop.
This commit is contained in:
@@ -116,6 +116,7 @@ public:
|
||||
virtual void Update(float dt);
|
||||
virtual void Render();
|
||||
virtual void ButtonPressed(int controllerId, int controlId);
|
||||
virtual void OnScroll(int inXVelocity, int inYVelocity);
|
||||
static float _x1[], _y1[], _x2[], _y2[], _x3[], _y3[], _x4[], _y4[];
|
||||
};
|
||||
|
||||
|
||||
@@ -827,6 +827,16 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
|
||||
menu->Close();
|
||||
}
|
||||
|
||||
void GameStateShop::OnScroll(int inXVelocity, int inYVelocity)
|
||||
{
|
||||
if (abs(inXVelocity) > 200)
|
||||
{
|
||||
bool flickLeft = (inXVelocity < 0);
|
||||
if(!flickLeft)
|
||||
mEngine->HoldKey_NoRepeat(JGE_BTN_PRI);
|
||||
}
|
||||
}
|
||||
|
||||
//ShopBooster
|
||||
ShopBooster::ShopBooster()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user