I can’t believe I never noticed this, but having your build.setting
like this for web/HTML5 builds makes everything work perfect in HTML5.
application =
{
content =
{
width = 480,
height = 320,
scale = "zoomEven",
fps = 60
},
}
It has to be zoomEven! And then in your game, you can use…
-- Called when the app's view has been resized
local function onResize( event )
-- do resize logic here with things like display.actualContentWidth
end
Runtime:addEventListener( "resize", onResize )
And I swear everything works perfect! Every other mode breaks the canvas somehow. But this mode literally does a perfect fit in the browser. Works on Chrome and Safari at least