public interface Graphic
Modifier and Type | Method and Description |
---|---|
void |
clear(int x,
int y,
int width,
int height)
Clear the display.
|
void |
clear(Resolution source)
Clear the display.
|
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
Copies an area of the component by a distance specified by
dx and dy . |
void |
dispose()
Dispose the graphic and release associated resources.
|
void |
drawGradient(int x,
int y,
int width,
int height)
Draws the specified gradient rectangle.
|
void |
drawImage(ImageBuffer image,
int x,
int y)
Draw an image to the graphic.
|
void |
drawImage(ImageBuffer image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2)
Draw a part of an image from a source rectangle to a destination rectangle.
|
void |
drawImage(ImageBuffer image,
Transform op,
int x,
int y)
Draw an image to the graphic.
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line, using the current color, between the points
(x1, y1) and
(x2, y2) in this graphic. |
void |
drawOval(int x,
int y,
int width,
int height,
boolean fill)
Fills an oval bounded by the specified rectangle with the current color.
|
void |
drawRect(int x,
int y,
int width,
int height,
boolean fill)
Draws the specified rectangle.
|
ColorRgba |
getColor()
Get the current color.
|
<G> G |
getGraphic()
Get the graphic context.
|
void |
setColor(ColorRgba color)
Set the current graphic color.
|
void |
setColorGradient(GradientColor gradientColor)
Set the gradient color.
|
<G> void |
setGraphic(G graphic)
Set the graphic context.
|
void clear(Resolution source)
source
- The resolution source.void clear(int x, int y, int width, int height)
x
- The horizontal location.y
- The vertical location.width
- The width.height
- The height.void dispose()
void copyArea(int x, int y, int width, int height, int dx, int dy)
dx
and dy
. From the point
specified by x
and y
, this method copies downwards and to the right.x
- the x coordinate of the source rectangle.y
- the y coordinate of the source rectangle.width
- the width of the source rectangle.height
- the height of the source rectangle.dx
- the horizontal distance to copy the pixels.dy
- the vertical distance to copy the pixels.void drawImage(ImageBuffer image, int x, int y)
image
- The image to draw.x
- The horizontal location.y
- The vertical location.void drawImage(ImageBuffer image, Transform op, int x, int y)
image
- The image to draw.op
- The affine transformation.x
- The horizontal location.y
- The vertical location.void drawImage(ImageBuffer image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
image
- The image to draw.dx1
- The x coordinate of the first corner of the destination rectangle.dy1
- The y coordinate of the first corner of the destination rectangle.dx2
- The x coordinate of the second corner of the destination rectangle.dy2
- The y coordinate of the second corner of the destination rectangle.sx1
- The x coordinate of the first corner of the source rectangle.sy1
- The y coordinate of the first corner of the source rectangle.sx2
- The x coordinate of the second corner of the source rectangle.sy2
- The y coordinate of the second corner of the source rectangle.void drawRect(int x, int y, int width, int height, boolean fill)
x
and
x + width - 1
. The top and bottom edges are at y
and
y + height - 1
. The resulting rectangle covers an area width
pixels
wide by height
pixels tall.x
- The horizontal location.y
- The vertical location.width
- The width.height
- The height.fill
- true
to fill the rectangle, false
to draw only its borders.void drawGradient(int x, int y, int width, int height)
x
and
x + width - 1
. The top and bottom edges are at y
and
y + height - 1
. The resulting rectangle covers an area width
pixels
wide by height
pixels tall.
The gradient is defined by setColorGradient(GradientColor)
.x
- The horizontal location.y
- The vertical location.width
- The width.height
- The height.void drawLine(int x1, int y1, int x2, int y2)
(x1, y1)
and
(x2, y2)
in this graphic.x1
- The first point's x coordinate.y1
- The first point's y coordinate.x2
- The second point's x coordinate.y2
- The second point's y coordinate.void drawOval(int x, int y, int width, int height, boolean fill)
x
- the x coordinate of the upper left corner of the oval to be filled.y
- the y coordinate of the upper left corner of the oval to be filled.width
- the width of the oval to be filled.height
- the height of the oval to be filled.fill
- true
to fill the rectangle, false
to draw only its borders.void setColor(ColorRgba color)
color
- The color.void setColorGradient(GradientColor gradientColor)
gradientColor
- The gradient color.<G> void setGraphic(G graphic)
G
- The graphic type used.graphic
- The graphic context.<G> G getGraphic()
G
- The graphic type used.ColorRgba getColor()
Copyright © 2014 Byron 3D Games Studio. All rights reserved.