|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.ui.utils.ScissorStack
public class ScissorStack
A scissor stack is a stack of Rectangle
to be used for clipping via GLCommon.glScissor(int, int, int, int)
.
When a new Rectangle is pushed onto the stack, it will be merged with the current top of stack. The minimum area of overlap is
then set as the real top of the stack.
Constructor Summary | |
---|---|
ScissorStack()
|
Method Summary | |
---|---|
static void |
calculateScissors(Camera camera,
Matrix4 batchTransform,
Rectangle area,
Rectangle scissor)
Calculates a scissor rectangle in OpenGL ES window coordinates from a Camera , a transformation Matrix4 and
an axis aligned Rectangle . |
static Rectangle |
getViewport()
|
static void |
popScissors()
Pops the current scissor rectangle from the stack and sets the new scissor area to the new TOS rectangle. |
static void |
pushScissors(Rectangle scissor)
Pushes a new scissor Rectangle onto the stack, merging it with the current top of the stack. |
static void |
toWindowCoordinates(Camera camera,
Matrix4 transformMatrix,
Vector2 point)
Transforms a point to real window coordinates (as oposed to OpenGL ES window coordinates), where the origin is in the top left and the the y-axis is pointing downwards |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScissorStack()
Method Detail |
---|
public static void pushScissors(Rectangle scissor)
Rectangle
onto the stack, merging it with the current top of the stack. The minimal area of
overlap between the TOS rectangle and the provided rectangle is pushed onto the stack. This will invoke
GLCommon.glScissor(int, int, int, int)
with the final TOS rectangle. In case no scissor is yet on the stack this
will also enable GL10.GL_SCISSOR_TEST
automatically.
scissor
- the scissor Rectanglepublic static void popScissors()
GL10.GL_SCISSOR_TEST
is disabled.
public static void calculateScissors(Camera camera, Matrix4 batchTransform, Rectangle area, Rectangle scissor)
Camera
, a transformation Matrix4
and
an axis aligned Rectangle
. The rectangle will get transformed by the camera and transform matrices and is then
projected to screen coordinates. Note that only axis aligned rectangles will work with this method. If either the Camera or
the Matrix4 have rotational components, the output of this method will not be suitable for
GLCommon.glScissor(int, int, int, int)
.
camera
- the Camera
batchTransform
- the transformation Matrix4
area
- the Rectangle
to transform to window coordinatesscissor
- the Rectangle to store the result inpublic static Rectangle getViewport()
public static void toWindowCoordinates(Camera camera, Matrix4 transformMatrix, Vector2 point)
camera
- the Camera
transformMatrix
- the transformation Matrix4
point
- the point to be transformed.
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |