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
sensors and multitouch
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
sensors and multitouch
Last edited by ghoulsblade on Tue Nov 22, 2011 6:56 am, edited 2 times in total.
love-android - gamejams
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
Re: sensors and multitouch
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)
-- 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
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: sensors and multitouch
This should have a more lövely argument IMO, like:ghoulsblade wrote: love.phone.setRequestedOrientation(love.phone.SCREEN_ORIENTATION.SCREEN_ORIENTATION_PORTRAIT)
Code: Select all
love.phone.setRequestedOrientation("portrait")
Re: sensors and multitouch
intresting, i've only just started using the love api with android and will have to look into this when i get home
Who is online
Users browsing this forum: No registered users and 1 guest