|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.genuts.gameui.Sprite | +--com.genuts.gameui.SpriteWrapper | +--com.genuts.gameui.MovingSpriteWrapper | +--com.genuts.gameui.MovingPrecisionSpriteWrapper
Sprite wrapper with the ability to move with precision positions. This sprite wrapper is an abstract class, it can only be extended directly to define its own behavior for moving.
The goal of this wrapper is to have a precision postion (double type) for x and y coordinates.
setPrecisionPosition(double, double)
,
getPrecisionX()
,
getPrecisionY()
Constructor Summary | |
MovingPrecisionSpriteWrapper(Sprite sprite)
Initializes the moving precision sprite with an action sprite. |
Method Summary | |
double |
getPrecisionX()
Gets the X position of the action sprite in the playfield with double type value. |
double |
getPrecisionY()
Gets the Y position of the action sprite in the playfield with double type value. |
void |
setActionSprite(Sprite sprite)
Sets the action sprite. |
boolean |
setPosition(int x,
int y)
Sets the position of the action sprite in the playfield. |
boolean |
setPrecisionPosition(double x,
double y)
Sets the position of the action sprite in the playfield with double type values. |
Methods inherited from class com.genuts.gameui.MovingSpriteWrapper |
move, tick |
Methods inherited from class com.genuts.gameui.Sprite |
getFinalWrapper, getWrapper, setWrapper, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MovingPrecisionSpriteWrapper(Sprite sprite)
sprite
- Action spriteMethod Detail |
public void setActionSprite(Sprite sprite)
setActionSprite
in class SpriteWrapper
sprite
- Action sprite.public boolean setPosition(int x, int y)
setPosition
in class SpriteWrapper
x
- X position of the sprite.y
- Y position of the sprite.
true
if the modification was done, false
otherwise.public boolean setPrecisionPosition(double x, double y)
double
type values.
x
- X position of the sprite.y
- Y position of the sprite.
true
if the modification was done, false
otherwise.public double getPrecisionX()
double
type value.
double
type value.public double getPrecisionY()
double
type value.
double
type value.
|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |