love.displayrotated

Available since LÖVE 11.3
This callback is not supported in earlier versions.

Called when the device display orientation changed, for example, user rotated their phone 180 degrees.

O.png Prior to 11.4, the orientation value was boolean instead of one of valid DisplayOrientation values! See below for workaround.  


Function

Synopsis

love.displayrotated( index, orientation )

Arguments

number index
The index of the display that changed orientation.
DisplayOrientation orientation
The new orientation.

Returns

Nothing.

Workaround

Due to a bug in LOVE 11.3, the orientation value is boolean true instead. A workaround is as follows:

function love.displayrotated(index, orientation)
    orientation = love.window.getDisplayOrientation(index)
    -- The rest of your code goes here.
end

See Also


Other Languages