Function tetra::graphics::set_scissor

source ·
pub fn set_scissor(ctx: &mut Context, scissor_rect: Rectangle<i32>)
Expand description

Sets the scissor rectangle.

While the scissor is enabled, any rendering that falls outside the specified rectangle of the screen (or the current canvas, if one is active) will be be ignored. This includes calls to clear. This can be useful for things like UI rendering.

To disable the scissor, call reset_scissor.

Note that the position/size of the scissor rectangle is not affected by the transform matrix - it always operates in screen/canvas co-ordinates.