Slick Forums

Discuss the Slick 2D Library
It is currently Sat Oct 19, 2019 8:12 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Use of Accelerometer?
PostPosted: Mon May 07, 2012 4:33 am 
Offline

Joined: Tue May 03, 2011 10:38 pm
Posts: 32
I'm curious, has anyone been able to use accelerometer information with Slick 2D AE? Do we already have something built in to handle it?


Top
 Profile  
 
PostPosted: Tue May 08, 2012 2:54 am 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
We don't, but since you brought it up, I've been looking around the code, and I think it can be done. I'm working on solutions for this and the build.xml java version thing. If I can set it up correctly, the accelerometer will be accessable through conainer.getInput().getAccelerometerX() and similar functions.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
PostPosted: Tue May 08, 2012 7:04 pm 
Offline

Joined: Tue May 03, 2011 10:38 pm
Posts: 32
That would be pretty awesome. There's no rush for this though, I'm just thinking ahead for another game I have in mind. I've never actually done anything with an accelerometer before, would the return be of int value? Are you using Controller to deal with it?


Top
 Profile  
 
PostPosted: Tue May 08, 2012 11:10 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
Done! The accelerometer can now be accessed by calling container.Input.getAccelerometerX() or y or z or roll or pitch. These return floats and are mostly portals to the LIBGDX api underneath. It's in the dev branch now. Still can't figure out ant... but thanks for the prompt.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group