Page 1 of 1

LADS - Testing shim on desktop/mouse environments

Posted: Fri Mar 06, 2015 10:02 pm
by nucular
Hello everybody!
This small library/tool started out as a simple touchscreen simulator for Android development on a desktop computer, simply because I cba to load the program to an AVD or my phone after every change. It kind of evolved into a rudimentary compatibility shim:

The LÖVE-Android on Desktop Shim
https://gist.github.com/nucular/a5782186ba0c181c1919

Features:
  • Two touchscreen behaviours ("single" and "multi")
  • Touchpoint overlay (disables love.mouse.setVisible for convenience)
  • Keyboard wrapper, keybinds for menu/back/return/search/textinput
  • love.touchgestured that may work (somebody should make a demo or something)
Non-features:
  • Overriding love.draw later in the code will disable drawing
    • Call lads.draw manually and pass "false" as the second argument to lads.hook
  • GLES shader code may differ and be incompatible in some ways (it's a subset though, so it should work in most cases)
Usage:
Add

Code: Select all

require("lads").hook()
to the very end of main.lua (or after love.draw is defined).
You can pass a string to switch between simple "single" behaviour and (unintuitive) "multi" behaviour.
By default, F5 to F9 are mapped to the Android menu/back/return/search/toggle keyboard keys, respectively. You can change this by modifying lads.keys["menu/back/return/search/textinput"].

single:
A left mousedown event will create a touchpoint on the screen and fire touchpressed. The point will follow the cursor and will be touchreleased together with the button.

multi:
Behaves like single until the mouse button is released. The touchpoints now stays on the screen and can be dragged with the left mouse button. Multiple touchpoints (up to lads.touchlimit) can be created and touchreleased by clicking them with the right mouse button.

Tested with:

Re: LADS - Testing shim on desktop/mouse environments

Posted: Wed Mar 18, 2015 10:50 pm
by undef
Thank you very very much!
That's so much more convenient than having to build it make a build all the time and copying it to the phone!

Re: LADS - Testing shim on desktop/mouse environments

Posted: Sat Mar 21, 2015 6:57 pm
by nucular
Update!
  • Changed hook method to modify love.event.poll (compatible with overriding love.x handlers on-the-go)
  • Added a kinda untested implementation of love.touchgestured
  • Always show the mouse cursor (disable love.mouse.setVisible) on the touchpoint interface

Re: LADS - Testing shim on desktop/mouse environments

Posted: Fri Mar 27, 2015 6:06 am
by I~=Spam
Could you add accelerometer emulation support?