Page 1 of 1

sensors and multitouch

Posted: Thu Nov 17, 2011 11:04 pm
by ghoulsblade
the first experimental multi touch and generic sensor access is already available via love.phone.* api extension
see readme at the bottom of https://github.com/hagish/love-android for api details,
or the comments in https://github.com/hagish/love-android/ ... Phone.java


here's a small sample that draws red dots at mulitouch points,
and lists available sensors,
and prints the data values of any "orientation" (gravity) sensor found.

sensortest demo : http://ghoulsblade.schattenkind.net/lov ... rtest.love

compass/pitch/roll demo thanks to miko : http://ghoulsblade.schattenkind.net/lov ... mpass.love

Re: sensors and multitouch

Posted: Fri Nov 18, 2011 3:29 am
by ghoulsblade
update :
-- orientation fixed for testing orientation sensor
love.phone.setRequestedOrientation(love.phone.SCREEN_ORIENTATION.SCREEN_ORIENTATION_PORTRAIT)

orientation sensor : apparently the first number is compass, and the next 2 are pitch and tilt or so

-- main key events : back,menu,search,home,leavehint
function love.phone.main_key_event (sEventName) gTxt3 = tostring(sEventName).." t="..gMyTicks end

-- haptic feedback, e.g. on button press
love.phone.setHapticFeedbackEnabled(true)
...
love.phone.performHapticFeedback(love.phone.FEEDBACK_CONSTANT.VIRTUAL_KEY)

Re: sensors and multitouch

Posted: Fri Nov 18, 2011 5:51 pm
by slime
ghoulsblade wrote: love.phone.setRequestedOrientation(love.phone.SCREEN_ORIENTATION.SCREEN_ORIENTATION_PORTRAIT)
This should have a more lövely argument IMO, like:

Code: Select all

love.phone.setRequestedOrientation("portrait")

Re: sensors and multitouch

Posted: Wed Jun 13, 2012 4:29 pm
by brad87uk
intresting, i've only just started using the love api with android and will have to look into this when i get home