Difference between revisions of "Framebuffer:renderTo"

(Created page with 'Render to the framebuffer using a function. == Function == === Synopsis === <source lang="lua"> Framebuffer:renderTo( func ) </source> === Arguments === {{param|function|fun…')
 
Line 33: Line 33:
  
 
== See Also ==
 
== See Also ==
* [[parent::Framebyffer]]
+
* [[parent::Framebuffer]]
 
* [[love.graphics.setRenderTarget]]
 
* [[love.graphics.setRenderTarget]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Render to a framebuffer using a fuction.}}
 
{{#set:Description=Render to a framebuffer using a fuction.}}

Revision as of 15:08, 19 September 2010

Render to the framebuffer using a function.

Function

Synopsis

Framebuffer:renderTo( func )

Arguments

function func
A function performing drawing operations.

Returns

Nothing.

Notes

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