|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.client.ui.AWT.BoardView1.Sprite
abstract class BoardView1.Sprite
Everything in the main map view is either the board or it's a sprite displayed on top of the board. Most sprites store a transparent image which they draw onto the screen when told to. Sprites keep a bounds rectangle, so it's easy to tell when they'return onscreen.
| Field Summary | |
|---|---|
protected java.awt.Rectangle |
bounds
|
protected boolean |
hidden
|
protected java.awt.Image |
image
|
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
BoardView1.Sprite()
|
|
| Method Summary | |
|---|---|
void |
drawOnto(java.awt.Graphics g,
int x,
int y,
java.awt.image.ImageObserver observer)
Draws this sprite onto the specified graphics context. |
void |
drawOnto(java.awt.Graphics g,
int x,
int y,
java.awt.image.ImageObserver observer,
boolean makeTranslucent)
|
java.awt.Rectangle |
getBounds()
Returns our bounding rectangle. |
java.lang.String[] |
getTooltip()
Since most sprites being drawn correspond to something in the game, this returns a little info for a tooltip. |
boolean |
imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
When we draw our buffered images, it's necessary to implement the ImageObserver interface. |
boolean |
isInside(java.awt.Point point)
Returns true if the point is inside this sprite. |
boolean |
isReady()
Are we ready to draw? |
abstract void |
prepare()
Do any necessary preparation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.Rectangle bounds
protected java.awt.Image image
protected boolean hidden
| Constructor Detail |
|---|
BoardView1.Sprite()
| Method Detail |
|---|
public abstract void prepare()
public boolean imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
imageUpdate in interface java.awt.image.ImageObserverpublic java.awt.Rectangle getBounds()
public boolean isReady()
public void drawOnto(java.awt.Graphics g,
int x,
int y,
java.awt.image.ImageObserver observer)
public void drawOnto(java.awt.Graphics g,
int x,
int y,
java.awt.image.ImageObserver observer,
boolean makeTranslucent)
public boolean isInside(java.awt.Point point)
public java.lang.String[] getTooltip()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||