clip()
and
noClip()
methods instead.@Deprecated
public class Clipper
extends java.lang.Object
import org.gicentre.utils.gui.Clipper; Clipper clipper; void setup() { //... size(600, 400); clipper = new Clipper(this, 100, 100, 300, 200); // x, y, width, height //... } void draw() { drawSomeStuffAsUsual(); clipper.startClipping(); drawStuffYouWantToClip(); clipper.stopClipping(); drawSomeOtherStuffAsUsual(); }
Modifier and Type | Field and Description |
---|---|
protected processing.core.PApplet |
applet
Deprecated.
|
Constructor and Description |
---|
Clipper(processing.core.PApplet applet)
Deprecated.
Creates a new clipper set to the bounds of the given sketch.
|
Clipper(processing.core.PApplet applet,
float x,
float y,
float width,
float height)
Deprecated.
Creates a new Clipper instance capable of limiting all drawing to within the given rectangular bounds.
|
Clipper(processing.core.PApplet applet,
java.awt.geom.Rectangle2D clippingRect)
Deprecated.
Creates a new Clipper instance capable of limiting all drawing to within the given rectangular bounds.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(float px,
float py)
Deprecated.
Reports whether or not the given point lies within the clipping rectangle.
|
boolean |
contains(processing.core.PVector p)
Deprecated.
Reports whether or not the given point lies within the clipping rectangle.
|
java.awt.geom.Rectangle2D |
getClippingRect()
Deprecated.
Reports the clipping rectangle, whether or not is is currently active.
|
boolean |
isClipping()
Deprecated.
Reports whether or not clipping mode is currently active.
|
boolean |
isEnabled()
Deprecated.
Reports whether or not clipping is enabled.
|
void |
setClippingRect(float x,
float y,
float width,
float height)
Deprecated.
Sets the clipping rectangle and applies it if currently clipping
|
void |
setClippingRect(java.awt.geom.Rectangle2D clippingRect)
Deprecated.
Sets the clipping rectangle and applies it if currently clipping
|
void |
setEnabled(boolean isEnabled)
Deprecated.
Determines whether or not clipping is enabled.
|
void |
startClipping()
Deprecated.
Starts clipping all drawn content to the screen bounds of the current clip area.
|
void |
stopClipping()
Deprecated.
Stops any active clipping.
|
public Clipper(processing.core.PApplet applet)
applet
- Sketch in which to enable clipping.public Clipper(processing.core.PApplet applet, float x, float y, float width, float height)
applet
- Sketch in which to enable clipping.x
- x coordinate of the top-left of the clipping rectangle.y
- y coordinate of the top-left of the clipping rectangle.width
- Width of the clipping rectangle.height
- Height of the clipping rectangle.startClipping()
,
stopClipping()
,
setEnabled(boolean)
public Clipper(processing.core.PApplet applet, java.awt.geom.Rectangle2D clippingRect)
applet
- Sketch in which to enable clipping.clippingRect
- Bounds of the rectangle within which clipping is to be applied.startClipping()
,
stopClipping()
,
setEnabled(boolean)
public void startClipping()
public void stopClipping()
public void setClippingRect(float x, float y, float width, float height)
x
- x coordinate of the top-left of the clipping rectangle.y
- y coordinate of the top-left of the clipping rectangle.width
- Width of the clipping rectangle.height
- Height of the clipping rectangle.public void setClippingRect(java.awt.geom.Rectangle2D clippingRect)
clippingRect
- The clipping rectangle to apply.public java.awt.geom.Rectangle2D getClippingRect()
public boolean contains(float px, float py)
px
- x coordinate of the point to test.py
- y coordinate of the point to test.public boolean contains(processing.core.PVector p)
p
- Point to test.public boolean isClipping()
startClipping()
and stopClipping()
method calls.isEnabled()
public boolean isEnabled()
isClipping()
, this returns true even before
startClipping()
and after stopClipping()
.isClipping()
,
setEnabled(boolean)
public void setEnabled(boolean isEnabled)
isEnabled
- Clipping will be enabled if true.