|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.gameEngine.item.StaticItem
public class StaticItem
Class StaticItem
represents a GameItem
that is static in
terms of size, position, and rotation relative to some other item. This
object is capable of listening to the Tangible
item and changes size,
position, and rotation accordingly. If the passed Tangible
object is
a GameRelatedObject
then this object will automatically be added as a
listener to the Tangible
item.
Constructor Summary | |
---|---|
StaticItem(Texture t,
int index,
Tangible b)
Creates a new StaticItem from a given Texture with a
specified index (lower indexes are rendered first). |
Method Summary | |
---|---|
void |
positionChanged(PositionChangedEvent e)
This is called whenever a Tangible object updates its position. |
void |
rotationChanged(RotationChangedEvent e)
This is called whenever a Tangible object changes its rotation. |
void |
sizeChanged(SizeChangedEvent e)
This is called whenever a Tangible object updates its position. |
Methods inherited from class vooga.gameEngine.item.GameItem |
---|
compareTo, getPosition, getRotation, getShape, getSize, getTexture, isVisible, move, resize, rotate, setPosition, setRotation, setSize, setVisibility |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StaticItem(Texture t, int index, Tangible b)
StaticItem
from a given Texture
with a
specified index (lower indexes are rendered first). The initial size,
position, and rotation of the texture relative to the Tangible
item will determine how the object is represented relative to that item
no matter how that item is changed.
t
- is the Texture
to be usedindex
- represents what layer to draw the item onb
- is the Tangible
this item should listen to
(automatically added if it is a GameRelatedObject
).Method Detail |
---|
public void positionChanged(PositionChangedEvent e)
PositionChangeListener
Tangible
object updates its position.
positionChanged
in interface PositionChangeListener
e
- the PositionChangedEvent
public void rotationChanged(RotationChangedEvent e)
RotationChangeListener
Tangible
object changes its rotation.
rotationChanged
in interface RotationChangeListener
e
- the RotationChangedEvent
public void sizeChanged(SizeChangedEvent e)
SizeChangeListener
Tangible
object updates its position.
sizeChanged
in interface SizeChangeListener
e
- the PositionChangedEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |