Class Scissors
java.lang.Object
io.github.cottonmc.cotton.gui.client.Scissors
Contains a stack for GL scissors for restricting the drawn area of a widget.
- Since:
- 2.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A single scissor frame in the stack. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
pop()
Pops the topmost scissor frame and refreshes the scissored area.static Scissors.Frame
push
(int x, int y, int width, int height) Pushes a new scissor frame onto the stack and refreshes the scissored area.
-
Method Details
-
push
Pushes a new scissor frame onto the stack and refreshes the scissored area.- Parameters:
x
- the frame's X coordinatey
- the frame's Y coordinatewidth
- the frame's width in pixelsheight
- the frame's height in pixels- Returns:
- the pushed frame
-
pop
public static void pop()Pops the topmost scissor frame and refreshes the scissored area.- Throws:
IllegalStateException
- if there are no scissor frames on the stack
-