Difference between revisions of "Framebuffer:renderTo"

m
Line 1: Line 1:
{{newin|[[0.7.0]]|070|type=function}}
+
{{newin|[[0.7.0]]|070|type=function}} {{oldin|[[0.8.0]]|080|type=function|text=It has been renamed to [[Canvas:renderTo]]}}
 
Render to the [[Framebuffer]] using a function.
 
Render to the [[Framebuffer]] using a function.
  

Revision as of 22:23, 5 February 2012

Available since LÖVE 0.7.0
This function is not supported in earlier versions.
Removed in LÖVE 0.8.0
It has been renamed to Canvas:renderTo.

Render to the Framebuffer using a function.

Function

Synopsis

Framebuffer:renderTo( func )

Arguments

function func
A function performing drawing operations.

Returns

Nothing.

Notes

This function will clear the target framebuffer.

This is a shortcut to love.graphics.setRenderTarget:

framebuffer:renderTo( func )

is the same as

love.graphics.setRenderTarget( framebuffer )
func()
love.graphics.setRenderTarget()

Examples

Using an anonymous function for drawing to a Framebuffer

framebuffer:renderTo(function()
    love.graphics.draw(image1, 0,0)
    love.graphics.draw(image2, 100,100)
end)

See Also

Other Languages