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

Alejandro Rios

07/16/2022, 10:22 PM
Hello, I'm working in a small project to learn compose, it's a simple Boggle game, i have this board and I'm trying to think how to detect the sequence of letters that the user touches, this sequence can be horizontal, vertical, diagonal. I have one composable for each die and one for the complete board. Does anyone have an idea/reference/tutorial/video/medium article on how I could do it?
I initially thought of using a
detectDragGestures
in the board composable, but I can't figure out how to calculate which die it is in from the position.
I've also tried to use a
pointerInteropFilter
on each die to detect when the user touch the die, but I find that the if I move my finger thought the board wont trigger more
onTouch
events 😅
r

Rafs

07/16/2022, 11:50 PM
You can model the whole system as an m x n grid where every cell item can be referenced by item[i][j]
5 Views