public class TransformableModel extends FeatureModel implements Transformable, Recyclable
Constructor and Description |
---|
TransformableModel()
Create a transformable model without configuration.
|
TransformableModel(Setup setup)
Create a transformable model.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(TransformableListener listener)
Add a listener.
|
int |
getHeight() |
int |
getOldHeight()
Get the old height.
|
int |
getOldWidth()
Get the old width.
|
double |
getOldX()
Get the old horizontal location.
|
double |
getOldY()
Get the old vertical location.
|
int |
getWidth() |
double |
getX() |
double |
getY() |
void |
moveLocation(double extrp,
Direction direction,
Direction... directions)
Move location using different directions.
|
void |
moveLocation(double extrp,
double vx,
double vy)
Move location using a simple force.
|
void |
moveLocationX(double extrp,
double vx)
Move location using a simple force.
|
void |
moveLocationY(double extrp,
double vy)
Move location using a simple force.
|
void |
recycle()
Recycle feature, to make it ready for reuse.
|
void |
removeListener(TransformableListener listener)
Remove a listener.
|
void |
setLocation(double x,
double y)
Set new location.
|
void |
setLocationX(double x)
Set new x location.
|
void |
setLocationY(double y)
Set new y location.
|
void |
setSize(int width,
int height)
Set surface size.
|
void |
teleport(double x,
double y)
Teleport to a new location.
|
void |
teleportX(double x)
Teleport to a new horizontal location.
|
void |
teleportY(double y)
Teleport to a new vertical location.
|
void |
transform(double x,
double y,
int width,
int height)
Transform the transformable.
|
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature, prepare
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener, prepare
getFeature, getFeatures, getFeaturesType, hasFeature
public TransformableModel()
public TransformableModel(Setup setup)
The Setup
can provide a valid SizeConfig
.
setup
- The setup reference.public void addListener(TransformableListener listener)
Transformable
addListener
in interface Transformable
listener
- The listener to add.public void removeListener(TransformableListener listener)
Transformable
removeListener
in interface Transformable
listener
- The listener to remove.public void moveLocation(double extrp, Direction direction, Direction... directions)
Mover
moveLocation
in interface Mover
extrp
- The extrapolation value.direction
- The primary direction.directions
- The other directions.public void moveLocationX(double extrp, double vx)
Mover
moveLocationX
in interface Mover
extrp
- The extrapolation value.vx
- The horizontal force.public void moveLocationY(double extrp, double vy)
Mover
moveLocationY
in interface Mover
extrp
- The extrapolation value.vy
- The vertical force.public void moveLocation(double extrp, double vx, double vy)
Mover
moveLocation
in interface Mover
extrp
- The extrapolation value.vx
- The horizontal force.vy
- The vertical force.public void teleport(double x, double y)
Mover
public void teleportX(double x)
Mover
public void teleportY(double y)
Mover
public void setLocation(double x, double y)
Mover
setLocation
in interface Mover
x
- The new horizontal location.y
- The new vertical location.public void setLocationX(double x)
Mover
setLocationX
in interface Mover
x
- The new horizontal location.public void setLocationY(double y)
Mover
setLocationY
in interface Mover
y
- The new vertical location.public void transform(double x, double y, int width, int height)
Transformable
transform
in interface Transformable
x
- The horizontal location.y
- The vertical location.width
- The width.height
- The height.public void setSize(int width, int height)
Transformable
setSize
in interface Transformable
width
- The width.height
- The height.public double getX()
getX
in interface Localizable
public double getY()
getY
in interface Localizable
public double getOldX()
Mover
public double getOldY()
Mover
public int getOldWidth()
Transformable
getOldWidth
in interface Transformable
public int getOldHeight()
Transformable
getOldHeight
in interface Transformable
public final void recycle()
Recyclable
recycle
in interface Recyclable
Copyright © 2017 Byron 3D Games Studio. All rights reserved.