Difference between revisions of "love.graphics.getMaxImageSize"

(Created page)
 
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{newin|[[0.9.0]]|090|type=function}}
+
{{newinoldin|[[0.9.0]]|090|[[0.10.0]]|100|type=function|text=Use [[love.graphics.getSystemLimits]] instead}}
 
Gets the max supported width or height of [[Image]]s and [[Canvas]]es.
 
Gets the max supported width or height of [[Image]]s and [[Canvas]]es.
  
Attempting to create an Image or a Canvas with a width *or* height greater than this number will give an error.
+
Attempting to create an Image with a width *or* height greater than this number will create a checkerboard-patterned image instead. Doing the same for a canvas will result in an error.
  
The returned number depends on the system running the code. It is safe to assume it will never be less than 1024 and will likely be 2048 or greater.
+
The returned number depends on the system running the code. It is safe to assume it will never be less than 1024 and will almost always be 2048 or greater.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 15: Line 15:
 
{{param|number|size|The max supported width or height of Images and Canvases.}}
 
{{param|number|size|The max supported width or height of Images and Canvases.}}
 
== Notes ==
 
== Notes ==
There is an [http://feedback.wildfiregames.com/report/opengl/feature/GL_MAX_TEXTURE_SIZE online database] which has collected info about the max image size for various systems. A good rule of thumb is to never create Images or Canvases with widths or heights greater than 2048.
+
There is an [http://feedback.wildfiregames.com/report/opengl/feature/GL_MAX_TEXTURE_SIZE online database] which has collected info about the max image size for various systems.
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
Line 23: Line 23:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Gets the max supported width or height of Images and Canvases.}}
 
{{#set:Description=Gets the max supported width or height of Images and Canvases.}}
{{#set:Sub-Category=State}}
+
{{#set:Sub-Category=SystemInfo}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.getMaxImageSize}}
 
{{i18n|love.graphics.getMaxImageSize}}

Latest revision as of 01:59, 17 July 2017

Available since LÖVE 0.9.0 and removed in LÖVE 0.10.0
Use love.graphics.getSystemLimits instead.

Gets the max supported width or height of Images and Canvases.

Attempting to create an Image with a width *or* height greater than this number will create a checkerboard-patterned image instead. Doing the same for a canvas will result in an error.

The returned number depends on the system running the code. It is safe to assume it will never be less than 1024 and will almost always be 2048 or greater.

Function

Synopsis

size = love.graphics.getMaxImageSize( )

Arguments

None.

Returns

number size
The max supported width or height of Images and Canvases.

Notes

There is an online database which has collected info about the max image size for various systems.

See Also


Other Languages