public class GameCanvas
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
background(Image image)
Sets the canvas background to the specified Image.
|
void |
background(int shade)
Sets the canvas background to the specified shade.
|
void |
background(int r,
int g,
int b)
Sets the canvas background to the specified color.
|
void |
clear()
Draws the specified background image or background color on the canvas.
|
void |
font(java.lang.String fontname,
int style,
int size)
Sets the canvas's font to the specified fontname, style and size.
|
void |
font(java.lang.String fontname,
int style,
int size,
int r,
int g,
int b)
Sets the canvas's font to the specified fontname, style, size, and color.
|
int |
height()
Returns the height of the canvas in pixels.
|
void |
putText(double n,
double x,
double y)
Writes the specified number n on the canvas at location (x, y).
|
void |
putText(int n,
double x,
double y)
Writes the specified number n on the canvas at location (x, y).
|
void |
putText(java.lang.String string,
double x,
double y)
Writes the specified String string on the canvas at location (x, y).
|
int |
width()
Returns the width of the canvas in pixels.
|
public int width()
public int height()
public void background(Image image)
public void background(int shade)
public void background(int r, int g, int b)
public void clear()
public void font(java.lang.String fontname, int style, int size)
public void font(java.lang.String fontname, int style, int size, int r, int g, int b)
public void putText(int n, double x, double y)
public void putText(double n, double x, double y)
public void putText(java.lang.String string, double x, double y)