https://kotlinlang.org logo
#compose
Title
# compose
n

Nat Strangerweather

02/05/2022, 6:12 PM
If I were to make an app like this word finder game in Compose, what gesture detector would I need to use? As it stands I can get each letter using the onpress gesture detector , but I guess this is more of a swipe gesture. Is this possible in Compose or would I need to use a games engine? See picture in thread.
👀 1
a

Adam Powell

02/05/2022, 6:15 PM
Modifier.pointerInput
gives you access to all of the input events you'll need for this
👍 2
n

Nat Strangerweather

02/05/2022, 6:19 PM
This is what I am currently using:
Copy code
.pointerInput(Unit) {
    detectTapGestures(
        onPress = { println(randomLetter)}
    )
},
it works but only for one letter at a time...
a

Adam Powell

02/05/2022, 7:34 PM
Check out how
detectTapGestures
is implemented, you can use
awaitPointerInputScope
to get individual down/move/up events during the different dispatch phases
n

Nat Strangerweather

02/05/2022, 7:36 PM
Thanks, I will check that out! 😊