public interface Drawable
A Drawable object is one that visually represents itself with an image that is contextless by itself but can be drawn to a Graphics context. Points on the image have x-coordinates, which are 0 at its left edge and increase from left to right, and y-coordinates, which are 0 at its top edge and increase from top to bottom. The drawn image has an origin point somewhere on (or off) it around which it is flipped, rotated, and scaled.
Modifier and Type | Method and Description |
---|---|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y)
Draws this Drawable to the specified Graphics context.
|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y,
boolean xFlip,
boolean yFlip,
double angle,
double alpha,
Filter filter)
Draws this Drawable to the specified Graphics context.
|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y,
double scale,
boolean xFlip,
boolean yFlip,
double alpha,
Filter filter)
Draws this Drawable to the specified Graphics context.
|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y,
int left,
int right,
int top,
int bottom)
Draws a rectangular region of this Drawable to the specified Graphics
context.
|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y,
int left,
int right,
int top,
int bottom,
boolean xFlip,
boolean yFlip,
double angle,
double alpha,
Filter filter)
Draws a rectangular region of this Drawable to the specified Graphics
context.
|
void |
draw(org.newdawn.slick.Graphics g,
int x,
int y,
int left,
int right,
int top,
int bottom,
double scale,
boolean xFlip,
boolean yFlip,
double alpha,
Filter filter)
Draws a rectangular region of this Drawable to the specified Graphics
context.
|
void draw(org.newdawn.slick.Graphics g, int x, int y)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originvoid draw(org.newdawn.slick.Graphics g, int x, int y, boolean xFlip, boolean yFlip, double angle, double alpha, Filter filter)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originxFlip
- If true, the drawn image is flipped along a vertical line
through the originyFlip
- If true, the drawn image is flipped along a horizontal line
through the originangle
- The angle in degrees by which to rotate the drawn image and
its xFlip and yFlip lines counterclockwise around the originalpha
- The drawn image's alpha (opacity) value from 0 to 1filter
- The Filter to apply to the drawn image, or null if none
should be applied. Not every Filter has an effect on every Drawable.void draw(org.newdawn.slick.Graphics g, int x, int y, double scale, boolean xFlip, boolean yFlip, double alpha, Filter filter)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originscale
- The factor by which to scale the drawn image around the
originxFlip
- If true, the drawn image is flipped along a vertical line
through the originyFlip
- If true, the drawn image is flipped along a horizontal line
through the originalpha
- The drawn image's alpha (opacity) value from 0 to 1filter
- The Filter to apply to the drawn image, or null if none
should be applied. Not every Filter has an effect on every Drawable.void draw(org.newdawn.slick.Graphics g, int x, int y, int left, int right, int top, int bottom)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originleft
- The x-coordinate on the image, relative to the origin, of the
drawn region's left edgeright
- The x-coordinate on the image, relative to the origin, of
the drawn region's right edgetop
- The y-coordinate on the image, relative to the origin, of the
drawn region's top edgebottom
- The y-coordinate on the image, relative to the origin, of
the drawn region's bottom edgevoid draw(org.newdawn.slick.Graphics g, int x, int y, int left, int right, int top, int bottom, boolean xFlip, boolean yFlip, double angle, double alpha, Filter filter)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originleft
- The x-coordinate on the image, relative to the origin, of the
drawn region's left edgeright
- The x-coordinate on the image, relative to the origin, of
the drawn region's right edgetop
- The y-coordinate on the image, relative to the origin, of the
drawn region's top edgebottom
- The y-coordinate on the image, relative to the origin, of
the drawn region's bottom edgexFlip
- If true, the drawn region is flipped along a vertical line
through the image's originyFlip
- If true, the drawn region is flipped along a horizontal line
through the image's originangle
- The angle in degrees by which to rotate the drawn region and
its xFlip and yFlip lines counterclockwise around the image's originalpha
- The drawn region's alpha (opacity) value from 0 to 1filter
- The Filter to apply to the drawn region, or null if none
should be applied. Not every Filter has an effect on every Drawable.void draw(org.newdawn.slick.Graphics g, int x, int y, int left, int right, int top, int bottom, double scale, boolean xFlip, boolean yFlip, double alpha, Filter filter)
g
- The Graphics context to draw this Drawable tox
- The x-coordinate on the Graphics context of the originy
- The y-coordinate on the Graphics context of the originleft
- The x-coordinate on the image, relative to the origin, of the
drawn region's left edgeright
- The x-coordinate on the image, relative to the origin, of
the drawn region's right edgetop
- The y-coordinate on the image, relative to the origin, of the
drawn region's top edgebottom
- The y-coordinate on the image, relative to the origin, of
the drawn region's bottom edgescale
- The factor by which to scale the drawn region around the
originxFlip
- If true, the drawn region is flipped along a vertical line
through the image's originyFlip
- If true, the drawn region is flipped along a horizontal line
through the image's originalpha
- The drawn region's alpha (opacity) value from 0 to 1filter
- The Filter to apply to the drawn region, or null if none
should be applied. Not every Filter has an effect on every Drawable.