Giter Site home page Giter Site logo

Comments (3)

dmalves avatar dmalves commented on May 21, 2024

Now, I keep correcting myself. I added GetGestureType and made it work properly. I see that
SetGesturesEnabled is not been used (implemented) It would be nice to choose what gestures to lesson to.
And about this:

bool IsGestureDetected(void)
{
/*
if (currentGesture == GESTURE_DRAG) TraceLog(INFO, "DRAG");
else if (currentGesture == GESTURE_TAP) TraceLog(INFO, "TAP");
else if (currentGesture == GESTURE_DOUBLETAP) TraceLog(INFO, "DOUBLE");
else if (currentGesture == GESTURE_HOLD) TraceLog(INFO, "HOLD");
else if (currentGesture == GESTURE_SWIPE_RIGHT) TraceLog(INFO, "RIGHT");
else if (currentGesture == GESTURE_SWIPE_UP) TraceLog(INFO, "UP");
else if (currentGesture == GESTURE_SWIPE_LEFT) TraceLog(INFO, "LEFT");
else if (currentGesture == GESTURE_SWIPE_DOWN) TraceLog(INFO, "DOWN");
else if (currentGesture == GESTURE_PINCH_IN) TraceLog(INFO, "PINCH IN");
else if (currentGesture == GESTURE_PINCH_OUT) TraceLog(INFO, "PINCH OUT");
*/

if (currentGesture != GESTURE_NONE) return true;
else return false;

}

Maybe it is a good idea to keep the trace logs on user events, but only on the debug version.

working sample:
https://gist.github.com/dmalves/b0961dbe161d4776bcac

from raylib.

victorfisac avatar victorfisac commented on May 21, 2024

Hi, I'm currently working on that at #67

IsScreenTouched() from 1.2 already checked TAP input so detecting the scene switch worked fine one per touch. But now in 1.3 IsGestureDetected() returns true when any type of input is detected (look at gestures.h Gestures enum type data, line 56).

You can improve the code just checking GetGestureType() return value. If you see IsGestureDetected() declaration, it just checks if GetGestureType() is not GESTURE_NONE, so you are doing the same thing twice.

from raylib.

raysan5 avatar raysan5 commented on May 21, 2024

Hi @dmalves! Gestures module has been reviewed in develop branch for raylib 1.4.

Thanks @victorfisac for taking care of this issue. I just merged your pull request #67 and commented it.

from raylib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.