|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tangible
Represents an item that has a Position
, Dimension
, and
Rotation2D
. Useful for making a BoundedItem
.
Method Summary | |
---|---|
Position |
getPosition()
Getter method for the current position of this item in the coordinate system used by the game. |
Rotation2D |
getRotation()
Getter method for the current rotation of this item in the coordinate system used by the game. |
java.awt.Shape |
getShape()
Method for getting a Shape representing the area that can be
rendered on screen. |
Dimension |
getSize()
Getter method for the current dimension of this item in the coordinate system used by the game. |
void |
move(double dx,
double dy)
Moves this object dx to the right and dy up, which is relative to the in game coordinate system. |
void |
resize(double dx,
double dy)
Change's the size of this object dx in width and dy in height, which is relative to the in game coordinate system. |
void |
rotate(double dtheta)
Rotates this object dtheta clockwise, which is relative to the Position defined the existing Rotation2D
associated with this object. |
void |
setPosition(Position p)
Moves this object to a specified Position . |
void |
setRotation(Rotation2D r)
Changes this object's rotation to the specified Rotation2D . |
void |
setSize(Dimension d)
Changes this object's size to a specified Dimension . |
Method Detail |
---|
Position getPosition()
Position
representing current positionDimension getSize()
Dimension
representing current sizeRotation2D getRotation()
Rotation2D
representing current
rotationvoid move(double dx, double dy)
PositionChangedEvent
when called.
dx
- the change in the x-axisdy
- the change in the y-axisvoid setPosition(Position p)
Position
. Fires a
PositionChangedEvent
when called.
p
- new position of the object (top left corner)void rotate(double dtheta)
Position
defined the existing Rotation2D
associated with this object. Fires a RotationChangedEvent
when
called.
dtheta
- is the angle to rotate the object in radiansvoid setRotation(Rotation2D r)
Rotation2D
.
Fires a RotationChangedEvent
when called.
r
- is new rotation of the objectvoid resize(double dx, double dy)
SizeChangedEvent
when called.
dx
- the change in the widthdy
- the change in the heightvoid setSize(Dimension d)
Dimension
. Fires a
SizeChangedEvent
when called.
d
- is new dimension of the object in the game's coordinate systemjava.awt.Shape getShape()
Shape
representing the area that can be
rendered on screen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |