public interface Graphic
Graphics
Modifier and Type | Method and Description |
---|---|
void |
clear(int x,
int y,
int width,
int height)
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 |
drawGradient(Viewer viewer,
Origin origin,
double x,
double y,
int width,
int height)
Draws the specified gradient rectangle.
|
void |
drawImage(ImageSurface image,
int x,
int y)
Draw an image to the graphic.
|
void |
drawImage(ImageSurface 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(ImageSurface 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 |
drawLine(Viewer viewer,
double x1,
double y1,
double x2,
double 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 |
drawOval(Viewer viewer,
Origin origin,
double x,
double 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.
|
void |
drawRect(Viewer viewer,
Origin origin,
double x,
double y,
int width,
int height,
boolean fill)
Draws the specified rectangle.
|
ColorRgba |
getColor()
Get the current color.
|
Object |
getGraphic()
Get the graphic context.
|
void |
setColor(ColorRgba color)
Set the current graphic color.
|
void |
setColorGradient(ColorGradient gradientColor)
Set the gradient color.
|
void |
setGraphic(Object graphic)
Set the graphic context.
|
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(ImageSurface image, int x, int y)
image
- The image to draw.x
- The horizontal location.y
- The vertical location.void drawImage(ImageSurface 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(ImageSurface 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 drawRect(Viewer viewer, Origin origin, double x, double 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.
Rendering is performed considering the viewer location.viewer
- The viewer reference.origin
- Origin point referential used.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(ColorGradient)
.x
- The horizontal location.y
- The vertical location.width
- The width.height
- The height.void drawGradient(Viewer viewer, Origin origin, double x, double 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(ColorGradient)
.
Rendering is performed considering the viewer location.viewer
- The viewer reference.origin
- Origin point referential used.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 drawLine(Viewer viewer, double x1, double y1, double x2, double y2)
(x1, y1)
and
(x2, y2)
in this graphic.
Rendering is performed considering the viewer location.viewer
- The viewer reference.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 drawOval(Viewer viewer, Origin origin, double x, double y, int width, int height, boolean fill)
viewer
- The viewer reference.origin
- Origin point referential used.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(ColorGradient gradientColor)
gradientColor
- The gradient color.void setGraphic(Object graphic)
graphic
- The graphic context.Object getGraphic()
ColorRgba getColor()
Copyright © 2016 Byron 3D Games Studio. All rights reserved.