com.annahid.libs.artenus.entities.behavior
Transformable
Interface for all entities that can be moved, rotated, and scaled. Sprites are good examples of
entities that have this behavior.
See Also:
public interface Transformable
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public Point2D | getPosition() Gets the current position of this entity. |
public float | getRotation() Gets the current rotational angle of this entity. |
public Point2D | getScale() Gets the 2-dimensional scaling factor for this entity. |
public void | move(float amountX, float amountY) Moves this entity the given distance. |
public void | rotate(float angle) Rotates this entity the given number of degrees. |
public void | setPosition(Point2D position) Sets the position of this entity. |
public void | setPosition(float x, float y) Sets the position of this entity. |
public void | setRotation(float angle) Sets the rotational angle of this entity. |
public void | setScale(float scaleValue) Sets the scaling factor for this entity. |
public void | setScale(float scaleX, float scaleY) Sets the scaling factor for this entity, specifying different values horizontally and
vertically. |
Method Detail
| getPosition |
|---|
public Point2D getPosition() Gets the current position of this entity. Returns:
Current 2-dimensional position |
| getRotation |
|---|
public float getRotation() Gets the current rotational angle of this entity. Returns:
Rotational angle in degrees |
| getScale |
|---|
public Point2D getScale() Gets the 2-dimensional scaling factor for this entity. Returns:
The scaling factor over horizontal and vertical axes |
| move | ||||
|---|---|---|---|---|
public void move(
float amountX,
float amountY
)Moves this entity the given distance. The translation will be relative to this entity's
current position. Parameters:
|
| rotate | ||
|---|---|---|
public void rotate(
float angle
)Rotates this entity the given number of degrees. This rotation will be relative to this
entity's current rotational angle. Parameters:
|
| setPosition | ||
|---|---|---|
public void setPosition(
Point2D position
)Sets the position of this entity. Parameters:
|
| setPosition | ||||
|---|---|---|---|---|
public void setPosition(
float x,
float y
)Sets the position of this entity. Parameters:
|
| setRotation | ||
|---|---|---|
public void setRotation(
float angle
)Sets the rotational angle of this entity. Parameters:
|
| setScale | ||
|---|---|---|
public void setScale(
float scaleValue
)Sets the scaling factor for this entity. Horizontal and vertical scaling factors will be set
to the same value. Parameters:
|
| setScale | ||||
|---|---|---|---|---|
public void setScale(
float scaleX,
float scaleY
)Sets the scaling factor for this entity, specifying different values horizontally and
vertically. Parameters:
|