Android tilt
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Android tilt
I see some games on android using tilt control like DUAL https://play.google.com/store/apps/deta ... n_US&pli=1 but I don't see anything in love2D to do that, would it still be possible?
lua,contrary to other language,give you as much space as moon
Re: Android tilt
I think, you are looking at accelerometerjoystick config option, that (when enabled) adds a "new" joystick that has 3 axes, so you can then use this to get tilt of phone:
Code: Select all
local joystick
function love.load()
joystick = love.joystick.getJoysticks()[1] -- note, that you may like to get all joystick and select the best one, this just gets the first one
end
function love.update(dt)
local x, y, z = joystick:getAxes() -- now you can get orientation of phone and process it
end
Re: Android tilt
thank you! I thought joystick was to display a joystick
lua,contrary to other language,give you as much space as moon
Who is online
Users browsing this forum: No registered users and 1 guest