Difference between revisions of "love.window.getFullscreenModes"

m (See Also: Removed checkMode)
(Added missing display argument)
Line 5: Line 5:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
modes = love.window.getFullscreenModes( )
+
modes = love.window.getFullscreenModes( display )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
None.
+
{{param|number|display (1)|The index of the display, if multiple monitors are available.}}
 
=== Returns ===
 
=== Returns ===
 
{{param|table|modes|A table of width/height pairs. (Note that this may not be in order.)}}
 
{{param|table|modes|A table of width/height pairs. (Note that this may not be in order.)}}

Revision as of 17:23, 23 January 2014

Available since LÖVE 0.9.0
Moved from love.graphics.getModes.


Gets a list of supported fullscreen modes.

Function

Synopsis

modes = love.window.getFullscreenModes( display )

Arguments

number display (1)
The index of the display, if multiple monitors are available.

Returns

table modes
A table of width/height pairs. (Note that this may not be in order.)

Examples

Format of the returned table

modes = love.window.getFullscreenModes()

-- modes = {
-- 	{ width = 320, height = 240 },
-- 	{ width = 640, height = 480 },
-- 	{ width = 800, height = 600 },
-- 	{ width = 1024, height = 768 },
-- 	...
-- }

Sort table to ensure it is in order

modes = love.window.getFullscreenModes()
table.sort(modes, function(a, b) return a.width*a.height < b.width*b.height end)   -- sort from smallest to largest

See Also


Other Languages