{{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.

== Function ==
=== Synopsis ===
<source lang="lua">
Framebuffer:renderTo( func )
</source>
=== Arguments ===
{{param|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]]:
<source lang="lua">
framebuffer:renderTo( func )
</source>
is the same as
<source lang="lua">
love.graphics.setRenderTarget( framebuffer )
func()
love.graphics.setRenderTarget()
</source>

== Examples ==
=== Using an anonymous function for drawing to a Framebuffer ===
<source lang="lua">
framebuffer:renderTo(function()
    love.graphics.draw(image1, 0,0)
    love.graphics.draw(image2, 100,100)
end)
</source>

== See Also ==
* [[parent::Framebuffer]]
* [[love.graphics.setRenderTarget]]
[[Category:Functions]]
{{#set:Description=Render to a framebuffer using a function.}}
== Other Languages ==
{{i18n|Framebuffer:renderTo}}