Artenus 2D Framework
Artenus Reference
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 TypeMethod and Description
public Point2DgetPosition()
Gets the current position of this entity.
public floatgetRotation()
Gets the current rotational angle of this entity.
public Point2DgetScale()
Gets the 2-dimensional scaling factor for this entity.
public voidmove(float amountX, float amountY)
Moves this entity the given distance.
public voidrotate(float angle)
Rotates this entity the given number of degrees.
public voidsetPosition(Point2D position)
Sets the position of this entity.
public voidsetPosition(float x, float y)
Sets the position of this entity.
public voidsetRotation(float angle)
Sets the rotational angle of this entity.
public voidsetScale(float scaleValue)
Sets the scaling factor for this entity.
public voidsetScale(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:
amountXThe horizontal translation
amountYThe vertical translation
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:
angleThe angle in degrees to rotate
setPosition
public void setPosition(
    Point2D position
)
Sets the position of this entity.
Parameters:
positionThe new position
setPosition
public void setPosition(
    float x,
    float y
)
Sets the position of this entity.
Parameters:
xThe x coordinate of the new position
yThe y coordinate of the new position
setRotation
public void setRotation(
    float angle
)
Sets the rotational angle of this entity.
Parameters:
angleRotational angle in degrees
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:
scaleValueScaling factor
setScale
public void setScale(
    float scaleX,
    float scaleY
)
Sets the scaling factor for this entity, specifying different values horizontally and vertically.
Parameters:
scaleXHorizontal scaling factor
scaleYVertical scaling factor