love.graphics.setScissor
Available since LÖVE 0.4.0 |
This function is not supported in earlier versions. |
Sets or disables scissor.
The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.
The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).
Contents
Function
Limits the drawing area to a specified rectangle.
Synopsis
love.graphics.setScissor( x, y, width, height )
Arguments
number x
- The x-coordinate of the upper left corner of the clipping rectangle.
number y
- The y-coordinate of the upper left corner of the clipping rectangle.
number width
- The width of the clipping rectangle.
number height
- The height of the clipping rectangle.
Returns
Nothing.
Function
Disables scissor.
Synopsis
love.graphics.setScissor( )
Arguments
None.
Returns
Nothing.
Examples
Only draw on the left side of the screen
function love.draw()
local windowWidth, windowHeight = love.graphics.getDimensions()
love.graphics.setScissor(0,0, windowWidth/2,windowHeight)
love.graphics.clear(0, 0, .5)
love.graphics.circle("fill", windowWidth/2,windowHeight/2, 100)
end
See Also
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