Difference between revisions of "love.graphics.newCanvas"

m
Line 21: Line 21:
 
{{param|number|width|The desired width of the Canvas.}}
 
{{param|number|width|The desired width of the Canvas.}}
 
{{param|number|height|The desired height of the Canvas.}}
 
{{param|number|height|The desired height of the Canvas.}}
 +
=== Returns ===
 +
{{param|Canvas|canvas|A new Canvas with specified width and height.}}
 +
 +
{{newin|[[0.9.0]]|090|type=variant}}
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
canvas = love.graphics.newCanvas( width, height, texture_type )
 +
</source>
 +
=== Arguments ===
 +
{{param|number|width|The desired width of the Canvas.}}
 +
{{param|number|height|The desired height of the Canvas.}}
 +
{{param|TextureMode|texture_type|The desired texture mode of the Canvas.}}
 
=== Returns ===
 
=== Returns ===
 
{{param|Canvas|canvas|A new Canvas with specified width and height.}}
 
{{param|Canvas|canvas|A new Canvas with specified width and height.}}

Revision as of 10:25, 9 April 2013

Available since LÖVE 0.8.0
It has been renamed from love.graphics.newFramebuffer.

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

canvas = love.graphics.newCanvas( )

Arguments

None.

Returns

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

Function

Synopsis

canvas = 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.
Available since LÖVE 0.9.0
This variant is not supported in earlier versions.

Function

Synopsis

canvas = love.graphics.newCanvas( width, height, texture_type )

Arguments

number width
The desired width of the Canvas.
number height
The desired height of the Canvas.
TextureMode texture_type
The desired texture mode of the Canvas.

Returns

Canvas canvas
A new Canvas with specified width and height.

See Also


Other Languages