Difference between revisions of "love.graphics.newCanvas"

(Created page with "{{newin|0.8.0|080|type=function}} Creates a new Canvas object for offscreen rendering. {{newobjectnotice}} == Function == === Synopsis === <source lang="lua"> framebuffe...")
 
m
Line 32: Line 32:
  
 
== Other Languages ==
 
== Other Languages ==
{{i18n|love.graphics.newFramebuffer}}
+
{{i18n|love.graphics.newCanvas}}

Revision as of 22:11, 5 February 2012

Available since LÖVE 0.8.0
This function is not supported in earlier versions.

Creates a new Canvas object for offscreen rendering.

O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!  



Function

Synopsis

framebuffer = love.graphics.newCanvas( )

Arguments

None.

Returns

Canvas canvas
A new Canvas with width/height equal to the window width/height.

Function

Synopsis

framebuffer = love.graphics.newCanvas( width, height )

Arguments

number width
The desired width of the Canvas.
number height
The desired height of the Canvas.

Returns

Canvas canvas
A new Canvas with specified width and height.

See Also


Other Languages