https://github.com/raidho36/love-multitouch
ABOUT
The 'love-multitouch' is an input handling library for LÖVE game framework. It functions as an extension to basic functionality rather than a replacement. It provides all the same features and a lot more other stuff on top of that.
FEATURES
- all basic framework touch input features
- registering double-tapping, registering held state
- force touch updates every frame, drop mid-frame touch updates (optional)
- fullscreen touch events processing
- custom screen areas touch events processing
- groups of custom areas
- individual touch status data, callbacks and gestures for each group
- layers for custom areas
- freeform geometry transform for invididual shapes and for layers
- rectangle and circle basic area shapes, convex polygon area shape
- groups of custom areas
- low to none GC footprint through recycling of objects
- FFI support
For the demo there are also keyboard controls:
up - select previous
down - select next
pageup - raise selected
pagedown - lower selected
del - delete sselected
f2 - add new group
f3 - add new layer
f4 - add new shape
f5 - cycle shape type
f6 - cycle shape group
It goes without saying it works on the phone. By the way, the buttons are implemented using the same library! Each button has a circle shape for it, and it's own group to which appropriate callback is attached. You can put this shit on your individual GUI elements and in-game entities if you're too lazy to check coordinates against their position! Still a good idea to do some camera frustum culling.
PS: nevermind the code in the demo, it's made using "write once read never" principle. The damn thing is almost as big as the library!