Skip to content

Trigger love.resize when changing Switch between docked/undocked#12

Open
ssmfd wants to merge 1 commit intolovebrew:masterfrom
ssmfd:dev/fix-switch-resize
Open

Trigger love.resize when changing Switch between docked/undocked#12
ssmfd wants to merge 1 commit intolovebrew:masterfrom
ssmfd:dev/fix-switch-resize

Conversation

@ssmfd
Copy link
Copy Markdown

@ssmfd ssmfd commented Jan 21, 2025

When docking/undocking the Switch (via pressing "Tab"), the resolution changes between 720p and 1080p, but the love.resize callback wasn't being triggered.

@TurtleP
Copy link
Copy Markdown
Collaborator

TurtleP commented Aug 10, 2025

Apologies on the late reply. I believe this was a bug in an older version of LÖVE 12, as I'm seeing updateMode calls resize:

require("nest").init({ console = "switch" })

function love.load()
end

function love.resize(width, height)
    print(width, height)
end

function love.draw(screen)
    local width, height = love.graphics.getDimensions()
    love.graphics.rectangle("fill", (width - 16) / 2, (height - 16) / 2, 16, 16)
end

function love.gamepadpressed(joystick, button)
end

function love.gamepadreleased(joystick, button)
end

function love.gamepadaxis(joystick, axis, value)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants