##### Views

- Page
- Discussion
- View source
- History

# love.graphics.setRenderTarget

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 love.graphics.setCanvas.

Sets or resets a Framebuffer as render target. All drawing operations until the next love.graphics.setRenderTarget will be directed to the Framebuffer object specified.

## Function

### Synopsis

love.graphics.setRenderTarget( framebuffer )

### Arguments

`Framebuffer framebuffer`
  The new render target.

### Returns

Nothing.

### Notes

Sets the render target to a specified Framebuffer. The specified Framebuffer will be cleared. All drawing operations until the next love.graphics.setRenderTarget will be redirected to the Framebuffer and not shown on the screen.

## Function

### Synopsis

love.graphics.setRenderTarget( )

### 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 framebuffer
love.graphics.setRenderTarget(framebuffer)
love.graphics.setColor(230,240,120)
love.graphics.rectangle('fill',0,0,100,100)
love.graphics.setRenderTarget()
-- draw scaled framebuffer to screen
love.graphics.setColor(255,255,255)
love.graphics.draw(framebuffer, 200,100, 0, .5,.5)

## See Also

- love.graphics
- Framebuffer
- Framebuffer:renderTo

## Other Languages

Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – Tiếng Việt – 한국어
More info

Retrieved from "https://www.love2d.org/wiki/love.graphics.setRenderTarget"
Categories: Templates | Functions

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Browse properties