public interface Graphics
FunGraphics
and Gdx2d).Modifier and Type | Method and Description |
---|---|
void |
clear()
Method which cleans up the display.
|
void |
clear(java.awt.Color c)
Method which cleans up the display.
|
void |
drawCircle(int posX,
int posY,
int f)
Draws a circle starting from
(Top left X, Top left Y) |
void |
drawFancyString(int posX,
int posY,
java.lang.String str,
java.awt.Color color,
int size)
Draws a text with a shadow
|
void |
drawFilledCircle(int posX,
int posY,
int radius)
Draws a circle starting from
(Top left X, Top left Y) |
void |
drawFilledOval(int posX,
int posY,
int width,
int height)
Draws an oval starting from
(Top left X, Top left Y) |
void |
drawFilledPolygon(java.awt.Polygon p,
java.awt.Color c)
Draw a filled polygon
|
void |
drawFillRect(int posX,
int posY,
int width,
int height)
Draw a filled rectangle in the color selected with setColor.
|
void |
drawFillRect(java.awt.Rectangle rect)
Draw a filled rectangle in the color selected with setColor.
|
void |
drawLine(int p1x,
int p1y,
int p2x,
int p2y)
Draw a line from P1 to P2 in the color selected with setColor.
|
void |
drawMirroredPicture(int posX,
int posY,
double angle,
GraphicsBitmap bitmap)
Draw a mirrored centered picture from a file (gif, jpg, png) to
(posX, posY) |
void |
drawPicture(int posX,
int posY,
GraphicsBitmap bitmap)
Draw a centered picture from a file (gif, jpg, png) to
(posX, posY) |
void |
drawRect(int posX,
int posY,
int width,
int height)
Draw an empty rectangle in the color selected with setColor().
|
void |
drawRect(java.awt.Rectangle rect) |
void |
drawString(int posX,
int posY,
java.lang.String str)
Draws a string at a given location.
|
void |
drawString(int posX,
int posY,
java.lang.String str,
java.awt.Color color,
int size)
Write the given string at
posX, posY |
void |
drawTransformedPicture(int posX,
int posY,
double angle,
double scale,
GraphicsBitmap bitmap)
Draw a centered picture from a file (gif, jpg, png) to
(posX, posY) |
void |
drawTransformedPicture(int posX,
int posY,
double angle,
double scale,
java.lang.String imageName)
Draw a centered picture from a file (gif, jpg, png) to
(posX, posY) . |
int |
getFrameHeight() |
int |
getFrameWidth()
Getters and setters
|
void |
setColor(java.awt.Color c)
Set the color of the future drawings
|
void |
setPenWidth(float width)
Sets the width of the pen
|
void |
setPixel(int x,
int y)
Draw the selected pixel with the color selected with setColor.
|
void |
setPixel(int x,
int y,
java.awt.Color c)
Draws a pixel with a given color.
|
void |
setPixel(int x,
int y,
int c)
Draws a pixel with a given color.
|
void clear()
void clear(java.awt.Color c)
void setColor(java.awt.Color c)
c
- Selected color for drawingvoid setPixel(int x, int y)
x
- X coordinate of the pixely
- Y coordinate of the pixelvoid setPixel(int x, int y, java.awt.Color c)
x
- X coordinatey
- Y coordinatec
- Color to use for this pixel (this pixel only, see setColor(Color)
void setPixel(int x, int y, int c)
x
- X coordinatey
- Y coordinatec
- Color to use (RGB coded)void setPenWidth(float width)
width
- The new width of the penvoid drawLine(int p1x, int p1y, int p2x, int p2y)
p1x
- X coordinate of P1p1y
- Y coordinate of P1p2x
- X coordinate of P2p2y
- Y coordinate of P2void drawFilledPolygon(java.awt.Polygon p, java.awt.Color c)
p
- c
- void drawRect(int posX, int posY, int width, int height)
posX
- X coordinate of the top left corner of the rectangleposY
- Y coordinate of the top left corner of the rectanglewidth
- Width of the rectangleheight
- Height of the rectanglevoid drawFillRect(int posX, int posY, int width, int height)
posX
- X coordinate of the top left corner of the rectangleposY
- Y coordinate of the top left corner of the rectanglewidth
- Width of the rectangleheight
- Height of the rectanglevoid drawRect(java.awt.Rectangle rect)
rect
- rectangle to drawvoid drawFillRect(java.awt.Rectangle rect)
rect
- rectangle to drawvoid drawCircle(int posX, int posY, int f)
(Top left X, Top left Y)
posX
- X top-left position of the circleposY
- Y top-left position of the circlef
- Diameter of the drawn circlevoid drawFilledCircle(int posX, int posY, int radius)
(Top left X, Top left Y)
posX
- X top-left position of the circleposY
- Y top-left position of the circleradius
- Radius of the drawn circlevoid drawFilledOval(int posX, int posY, int width, int height)
(Top left X, Top left Y)
posX
- X top-left position of the circleposY
- Y top-left position of the circlewidth
- Width of the drawn ovalheight
- Height of the drawn ovalvoid drawString(int posX, int posY, java.lang.String str)
posX
- X position of stringposY
- Y position of stringstr
- the string to writevoid drawString(int posX, int posY, java.lang.String str, java.awt.Color color, int size)
posX, posY
posX
- Position x of the stringposY
- Position y of the stringstr
- The string to be drawncolor
- The color of the stringsize
- The size of the fontvoid drawFancyString(int posX, int posY, java.lang.String str, java.awt.Color color, int size)
posX
- posY
- str
- color
- size
- void drawPicture(int posX, int posY, GraphicsBitmap bitmap)
(posX, posY)
posX
- X position of the imageposY
- Y position of the imagefilename
- path of the image filevoid drawTransformedPicture(int posX, int posY, double angle, double scale, java.lang.String imageName)
(posX, posY)
. Warning,
very slow because the image has to be
reloadedposX
- X position of the imageposY
- Y position of the imageangle
- The rotation angle of the image to be drawnimageName
- path of the image filevoid drawTransformedPicture(int posX, int posY, double angle, double scale, GraphicsBitmap bitmap)
(posX, posY)
posX
- X position of the imageposY
- Y position of the imageangle
- The rotation angle of the image to be drawnbitmap
- A #SimpleGraphicsBitmap()
bitmapvoid drawMirroredPicture(int posX, int posY, double angle, GraphicsBitmap bitmap)
(posX, posY)
posX
- X position of the imageposY
- Y position of the imageangle
- The rotation angle of the image to be drawnbitmap
- A #SimpleGraphicsBitmap()
bitmapint getFrameWidth()
int getFrameHeight()