public class TransformableModel extends TraitModel implements Transformable
The ObjectGame
owner must provide a valid Configurer
compatible
with SizeConfig
.
Constructor and Description |
---|
TransformableModel()
Create a transformable model.
|
Modifier and Type | Method and Description |
---|---|
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 |
prepare(ObjectGame owner,
Services services)
Prepare the trait.
|
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.
|
getOwner
public void prepare(ObjectGame owner, Services services)
Trait
prepare
in interface Trait
prepare
in class TraitModel
owner
- The owner reference.services
- The services reference.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 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 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
Copyright © 2016 Byron 3D Games Studio. All rights reserved.