Difference between revisions of "love.graphics.setCanvas"

(Created page with "{{newin|0.8.0|080|type=function}} == Function == === Synopsis === <source lang="lua"> love.graphics.setCanvas( canvas ) </source> === Arguments === {{param|Canvas|canvas|The...")
 
Line 1: Line 1:
 
{{newin|[[0.8.0]]|080|type=function}}
 
{{newin|[[0.8.0]]|080|type=function}}
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Revision as of 22:05, 5 February 2012

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

Function

Synopsis

love.graphics.setCanvas( canvas )

Arguments

Canvas canvas
The new target.

Returns

Nothing.

Notes

Sets the render target to a specified Canvas. All drawing operations until the next love.graphics.setCanvas call will be redirected to the Canvas and not shown on the screen.

Function

Synopsis

love.graphics.setCanvas( )

Arguments

None.

Returns

Nothing.

Notes

Resets the render target to the screen, i.e. re-enables drawing to the screen.

Examples

Drawing to a framebuffer

-- draw colored square to canvas
love.graphics.setCanvas(canvas)
love.graphics.setColor(230,240,120)
love.graphics.rectangle('fill',0,0,100,100)
love.graphics.setCanvas()

-- draw scaled canvas to screen
love.graphics.setColor(255,255,255)
love.graphics.draw(canvas, 200,100, 0, .5,.5)

See Also


Other Languages