Multitouch handling library (also neat for desktop)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Multitouch handling library (also neat for desktop)

Post by raidho36 »

MULTITOUCH INPUT HANDLING LIBRARY FOR LÖVE

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
  • low to none GC footprint through recycling of objects
  • FFI support
https://github.com/raidho36/love-multitouch

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. :crazy: The damn thing is almost as big as the library!
Attachments
love-multitouch.love
(205.11 KiB) Downloaded 143 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 238 guests