Swiping in Android port
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Swiping in Android port
So, how does swiping work on love-android-sdl2? I've read a bit about love.touchmoved() but can't really seem to understand it. Any help would be greatly appreciated!
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: Swiping in Android port
I remember a library for gestures in LÖVE called Swingers but I'm not really sure if it is still working.
About the new Android API, there's nothing too complicated, the trio is:
love.touchpressed(id, x, y, pressure)
love.touchmoved(id, x, y, pressure)
love.touchreleased(id, x, y, pressure)
and these 3 functions represent the "life cycle" of each touch. You would need to code something if you want gesture support (this if it's not a library for this already). Good luck!
EDIT: Try to avoid Martin's android-sdl port (terrific work but there's official support now).
About the new Android API, there's nothing too complicated, the trio is:
love.touchpressed(id, x, y, pressure)
love.touchmoved(id, x, y, pressure)
love.touchreleased(id, x, y, pressure)
and these 3 functions represent the "life cycle" of each touch. You would need to code something if you want gesture support (this if it's not a library for this already). Good luck!
EDIT: Try to avoid Martin's android-sdl port (terrific work but there's official support now).
Re: Swiping in Android port
What do you mean by Martin's port? Isn't that the official Löve one?EDIT: Try to avoid Martin's android-sdl port (terrific work but there's official support now).
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Swiping in Android port
Yes it is.Kasperelo wrote: What do you mean by Martin's port? Isn't that the official Löve one?
Re: Swiping in Android port
Maybe he meant the 0.9.2 version?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Swiping in Android port
I'm using the 0.10.0 version.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: Swiping in Android port
Sorry, and yes, I meant to use the official API support in LÔVE 0.10.0, there are some key differences like you may notice, like the coordinates (now we have real pixels and not 0-1 ranges) and the id not being a number.
EDIT: There's a snippet in the wiki which shows you how to use touches in 0.10.0: https://love2d.org/wiki/love.touch.getPosition
To use them in love.touchpressed/released/moved, it's almost the same as in the old port, just remember the id is not a number anymore.
EDIT: There's a snippet in the wiki which shows you how to use touches in 0.10.0: https://love2d.org/wiki/love.touch.getPosition
To use them in love.touchpressed/released/moved, it's almost the same as in the old port, just remember the id is not a number anymore.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 7 guests