mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Added joystick vibration support for most common controllers (resolves issue #159).
Added Joystick:setVibration(left, right), Joystick:getVibration, and Joystick:isVibrationSupported. left and right are numbers between 0 and 1 which correspond to the strength of the gamepad's left and right rumble motors, if it has them.
This commit is contained in:
@@ -1502,11 +1502,17 @@ function love.errhand(msg)
|
||||
end
|
||||
end
|
||||
|
||||
-- Load.
|
||||
-- Reset state.
|
||||
if love.mouse then
|
||||
love.mouse.setVisible(true)
|
||||
love.mouse.setGrabbed(false)
|
||||
end
|
||||
if love.joystick then
|
||||
-- Stop all joystick vibrations.
|
||||
for i,v in ipairs(love.joystick.getJoysticks()) do
|
||||
v:setVibration()
|
||||
end
|
||||
end
|
||||
if love.audio then love.audio.stop() end
|
||||
love.graphics.reset()
|
||||
love.graphics.setBackgroundColor(89, 157, 220)
|
||||
|
||||
Reference in New Issue
Block a user