de.esw.eengine.renderable
Class HierarchyNode
java.lang.Object
de.esw.eengine.renderable.AbstractRenderable
de.esw.eengine.renderable.HierarchyNode
- All Implemented Interfaces:
- IActivatable, IRenderable, IScriptable<HierarchyNode>, IUpdateable
- Direct Known Subclasses:
- SceneEntity, SceneNode
public abstract class HierarchyNode
- extends AbstractRenderable
- implements IActivatable, IUpdateable, IScriptable<HierarchyNode>
- Since:
- 1.0
- Version:
- $Id: HierarchyNode.java 125 2005-06-27 13:42:55Z markusw $
- Author:
- markusw
|
Constructor Summary |
HierarchyNode(java.lang.String name,
int x,
int y)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HierarchyNode
public HierarchyNode(java.lang.String name,
int x,
int y)
- Parameters:
name - Name for this nodex - X locationy - Y location
setActive
public void setActive(boolean active)
- Specified by:
setActive in interface IActivatable
- Parameters:
active - True if IActivatable should be active, false
otherwise- See Also:
IActivatable.setActive(boolean)
isActive
public boolean isActive()
- Specified by:
isActive in interface IActivatable
- Returns:
- True if
IActivatable is active, false otherwise - See Also:
IActivatable.isActive()
toggle
public void toggle()
- Description copied from interface:
IActivatable
- Switches activation state
- Specified by:
toggle in interface IActivatable
- See Also:
IActivatable.toggle()
update
public void update(float delta)
- Specified by:
update in interface IUpdateable
- Parameters:
delta - Time in millis since last update- See Also:
IUpdateable.update(float)
getX
public final int getX()
- Returns:
- X location relative to parent
SceneNode
setX
public final void setX(int x)
- Parameters:
x - X location relative to parent SceneNode
getY
public final int getY()
- Returns:
- Y location relative to parent
SceneNode
setY
public final void setY(int y)
- Parameters:
y - Y location relative to parent SceneNode
setLocation
public final void setLocation(int x,
int y)
- Parameters:
x - X location relative to parent SceneNodey - Y location relative to parent SceneNode
move
public final void move(int dx,
int dy)
- Parameters:
dx - Delta x location to movedy - Delta y location to move
getAbsoluteX
public abstract int getAbsoluteX()
- Returns:
- X location in absolute coordinates
getAbsoluteY
public abstract int getAbsoluteY()
- Returns:
- Y location in absolute coordinates
getWidth
public int getWidth()
- Returns:
- Width of this
HierarchyNode
getHeight
public int getHeight()
- Returns:
- Height of this
HierarchyNode
getScaleX
public final float getScaleX()
- Returns:
- X scale factor
setScale
public final void setScale(float x,
float y)
- Parameters:
x - X scale factor to set.y - Y scale factor to set.
getScaleY
public final float getScaleY()
- Returns:
- Y scale factor
setScaleY
public final void setScaleY(float scaleY)
- Parameters:
scaleY - The scaleY to set.
scale
public final void scale(float x,
float y)
- Parameters:
x - X scale factory - Y scale factor
getVx
public final float getVx()
- Returns:
- Returns the vx.
setVx
public final void setVx(float vx)
- Parameters:
vx - The vx to set.
getVy
public final float getVy()
- Returns:
- Returns the vy.
setVy
public final void setVy(float vy)
- Parameters:
vy - The vy to set.
setVelocity
public final void setVelocity(float vx,
float vy)
- Parameters:
vx - X velocity of this Spritevy - Y velocity of this Sprite
getBoundingVolume
public final BoundingVolume getBoundingVolume()
- Returns:
- Returns the boundingVolume.
setBoundingVolume
public final void setBoundingVolume(BoundingVolume boundingVolume)
- Parameters:
boundingVolume - The boundingVolume to set.
printHierarchy
public void printHierarchy()
addScript
public void addScript(IScript<HierarchyNode> script)
- Specified by:
addScript in interface IScriptable<HierarchyNode>
- Parameters:
script - IScript to add- See Also:
IScriptable.addScript(de.esw.eengine.core.IScript)
removeScript
public void removeScript(IScript<HierarchyNode> script)
- Specified by:
removeScript in interface IScriptable<HierarchyNode>
- Parameters:
script - IScript to remove- See Also:
IScriptable.removeScript(de.esw.eengine.core.IScript)
getScripts
public java.util.HashMap<java.lang.String,IScript<HierarchyNode>> getScripts()
- Specified by:
getScripts in interface IScriptable<HierarchyNode>
- Returns:
- List of all
IScripts - See Also:
IScriptable.getScripts()
getScriptByName
public IScript<HierarchyNode> getScriptByName(java.lang.String name)
- Specified by:
getScriptByName in interface IScriptable<HierarchyNode>
- Parameters:
name - Name of the script to return
- Returns:
IScript with the given name- See Also:
IScriptable.getScriptByName(java.lang.String)