Difference between revisions of "love.graphics.getModes"

m (Add see alsos)
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{oldin|[[0.9.0]]|090|type=function|text=Moved to the [[love.window]] module as [[love.window.getFullscreenModes]]}}
 +
 
Gets a list of supported fullscreen modes.
 
Gets a list of supported fullscreen modes.
 
== Function ==
 
== Function ==
Line 21: Line 23:
 
-- ...
 
-- ...
 
-- }
 
-- }
 +
</source>
 +
=== Sort table to ensure it is in order ===
 +
<source lang="lua">
 +
modes = love.graphics.getModes()
 +
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 ==
Line 29: Line 36:
 
{{#set:Description=Gets a list of supported fullscreen modes.}}
 
{{#set:Description=Gets a list of supported fullscreen modes.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
 +
{{#set:Sub-Category=Window}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.getModes}}
 
{{i18n|love.graphics.getModes}}

Latest revision as of 01:18, 30 August 2013

Removed in LÖVE 0.9.0
Moved to the love.window module as love.window.getFullscreenModes.


Gets a list of supported fullscreen modes.

Function

Synopsis

modes = love.graphics.getModes( )

Arguments

None.

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.graphics.getModes()

-- 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.graphics.getModes()
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