sensors and multitouch

A project to port LÖVE to Android handhelds
Locked
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

sensors and multitouch

Post 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
Last edited by ghoulsblade on Tue Nov 22, 2011 6:56 am, edited 2 times in total.
love-android - gamejams
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: sensors and multitouch

Post 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)
love-android - gamejams
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: sensors and multitouch

Post 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")
brad87uk
Prole
Posts: 3
Joined: Wed Jun 13, 2012 4:15 pm

Re: sensors and multitouch

Post 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
Locked

Who is online

Users browsing this forum: No registered users and 49 guests