|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.haphazard.gui.engine.GraphicalObject
org.haphazard.gui.engine.MoveableGraphicalObject
This class handles all the dynamic graphical objects like character or enemys
| Field Summary | |
protected Vector3D |
mFacing
|
protected Point3D |
mLocation
|
protected Map |
mMap
|
protected Vector3D |
mSpeedVector
|
boolean |
mUseFogOfWar
|
| Fields inherited from class org.haphazard.gui.engine.GraphicalObject |
id, mDefaultSprite, mDescription, mDescriptionColor, mDescriptionDisplayTime, mDescriptionStartTime, mDimension, mLink, mName, mSpriteDisplayed, mSprites, mWeight |
| Constructor Summary | |
MoveableGraphicalObject()
Default constructor |
|
MoveableGraphicalObject(Sprite defaultSprite)
The constructor that handles all initilization |
|
MoveableGraphicalObject(java.lang.String name)
The constructor that handles all initilization from a XML-file NOTE: This is using GlobalWorld.getCurrentMap() to set this object on the map so |
|
| Method Summary | |
Vector3D |
getFacing()
Gets the facing of this object |
Point3D |
getLocation()
Finds the tile the character currently resides in |
Map |
getMap()
Gets the map the character currently resides on |
void |
load(java.io.InputStream stream)
Loads an object from a file |
static GraphicalObject |
loadInstance(java.io.InputStream stream)
Loads an object from a file |
boolean |
paintComponent(java.awt.Graphics2D g,
Map map,
java.awt.Point middleTileCoordinate)
paints the component on the screen. |
boolean |
paintComponent(java.awt.Graphics2D g,
Map map,
java.util.Vector topToLeft,
java.util.Vector rightToBottom,
java.awt.Point middleTileCoordinate)
paints the component on the screen. |
void |
setFacing(Point3D point)
Makes the character face a point |
void |
setLocation(Point3D location,
Map map)
Sets the characters location in the world |
void |
setSpeed(Vector3D speed)
Sets the characters speed |
java.lang.String |
toXML(int indent)
Transforms this object into XML-notation |
void |
update()
Updates this character Should be called every frame update |
| Methods inherited from class org.haphazard.gui.engine.GraphicalObject |
addSprite, combineSprites, displayDescription, displaySprite, getAvailableSprites, getBoundingBox, getDescription, getDimension, getName, getNotResettedSprite, getResettedSprite, getWeight, isDefaultSpriteDisplayed, optimize, resetDisplayedSprite, save, setDefaultSprite, setDefaultSprite, setDescription, setDimension, setName, setWeight, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Point3D mLocation
protected Vector3D mSpeedVector
protected Vector3D mFacing
protected Map mMap
public boolean mUseFogOfWar
| Constructor Detail |
public MoveableGraphicalObject()
public MoveableGraphicalObject(Sprite defaultSprite)
defaultSprite - The Sprite to set as defaultpublic MoveableGraphicalObject(java.lang.String name)
name - the name of the object| Method Detail |
public void setLocation(Point3D location,
Map map)
map - The map the tile exists inpublic Point3D getLocation()
public void setSpeed(Vector3D speed)
speed - The speed to setpublic Vector3D getFacing()
public void setFacing(Point3D point)
point - The point to turn the character towardspublic Map getMap()
public void update()
public boolean paintComponent(java.awt.Graphics2D g,
Map map,
java.awt.Point middleTileCoordinate)
paintComponent in class GraphicalObjectg - The graphics to use to paint withmap - the ground that "draw" this DGO. This is needed for displacementmiddleTileCoordinate - The middle coordinate of the tile the object is residing on
public boolean paintComponent(java.awt.Graphics2D g,
Map map,
java.util.Vector topToLeft,
java.util.Vector rightToBottom,
java.awt.Point middleTileCoordinate)
g - The graphics to use to paint withmap - the map that "draw" this DGO. This is needed for displacementpublic void load(java.io.InputStream stream)
load in class GraphicalObjectstream - The stream to loadpublic static GraphicalObject loadInstance(java.io.InputStream stream)
stream - The stream to load from
public java.lang.String toXML(int indent)
toXML in class GraphicalObjectindent - The level of indentation to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||