Difference between revisions of "love.window.getFullscreenModes"

m (moved love.window.getModes to love.window.getFullscreenModes: function has been renamed)
 
(3 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
modes = love.window.getModes( )
+
modes = love.window.getFullscreenModes( displayindex )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
None.
+
{{param|number|displayindex (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.)}}
Line 14: Line 14:
 
=== Format of the returned table ===
 
=== Format of the returned table ===
 
<source lang="lua">
 
<source lang="lua">
modes = love.window.getModes()
+
modes = love.window.getFullscreenModes()
  
 
-- modes = {
 
-- modes = {
Line 26: Line 26:
 
=== Sort table to ensure it is in order ===
 
=== Sort table to ensure it is in order ===
 
<source lang="lua">
 
<source lang="lua">
modes = love.window.getModes()
+
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
 
table.sort(modes, function(a, b) return a.width*a.height < b.width*b.height end)  -- sort from smallest to largest
 
</source>
 
</source>
 
== See Also ==
 
== See Also ==
 
* [[parent::love.window]]
 
* [[parent::love.window]]
* [[love.window.checkMode]]
 
 
* [[love.window.setMode]]
 
* [[love.window.setMode]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Gets a list of supported fullscreen modes.}}
 
{{#set:Description=Gets a list of supported fullscreen modes.}}
 
{{#set:Since=090}}
 
{{#set:Since=090}}
 +
 
== Other Languages ==
 
== Other Languages ==
{{i18n|love.window.getModes}}
+
{{i18n|love.window.getFullscreenModes}}

Latest revision as of 22:59, 24 June 2021

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( displayindex )

Arguments

number displayindex (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