Available since LÖVE 0.9.0
Moved from love.graphics.setMode.
Sets the display mode and properties of the window.
If width or height is 0, setMode will use the width and height of the desktop.
Changing the display mode may have side effects: for example, canvases will be cleared and values sent to shaders with Shader:send will be erased. Make sure to save the contents of canvases beforehand or re-draw to them afterward if you need to.
success = love.window.setMode( width, height, flags )
number width
number height
table flags
boolean fullscreen (false)
FullscreenType fullscreentype ("desktop")
boolean vsync (true)
number msaa (0)
boolean resizable (false)
boolean borderless (false)
boolean centered (true)
number display (1)
number minwidth (1)
number minheight (1)
boolean highdpi (false)
number x (nil)
number y (nil)
boolean srgb (false)
boolean success
If fullscreen is enabled and the width or height is not supported (see love.window.getFullscreenModes), the window may be resized to the closest available resolution and a resize event will be triggered.
If the fullscreen type is "desktop", then the window will be automatically resized to the desktop resolution.
If you have disabled the window in conf.lua (i.e. t.window = false
) and use this function to manually create the window, then you must not call any other love.graphics.* function before this one. Doing so will result in undefined behavior and/or crashes because OpenGL cannot function properly without a window.
Transparent backgrounds are currently not supported.
function love.load() love.window.setMode(800, 600, {resizable=true, vsync=false, minwidth=400, minheight=300}) end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.window.setMode