public class Actor extends java.lang.Object implements GGBorderListener, GGActorCollisionListener, GGTileCollisionListener
Modifier and Type | Field and Description |
---|---|
GameGrid |
gameGrid
The reference to the GameGrid instance.
|
int |
nbCycles
The current number of simulation cycles since last reset.
|
Constructor and Description |
---|
Actor()
Constructs an actor with no sprite image.
|
Actor(android.graphics.Bitmap... spriteImages)
Constructs an unrotatable actor based on one or several sprite images
defined by the given bitmaps.
|
Actor(boolean isRotatable,
android.graphics.Bitmap... spriteImages)
Constructs an actor based on one several sprite images defined by the given
bitmaps.
|
Actor(boolean isRotatable,
android.graphics.Bitmap spriteImage)
Constructs actor based on the specified bitmap.
|
Actor(boolean isRotatable,
java.lang.String... filenames)
Constructs an actor based on one several sprite images.
|
Actor(boolean isRotatable,
java.lang.String filename)
Constructs an actor based on the specified sprite image.
|
Actor(boolean isRotatable,
java.lang.String filename,
int nbSprites)
Constructs an actor based on one or more sprite images.
|
Actor(java.lang.String... filenames)
Constructs an unrotatable actor based on several sprite images.
|
Actor(java.lang.String filename)
Constructs an unrotatable actor based on the specified sprite image.
|
Actor(java.lang.String filename,
int nbSprites)
Constructs an unrotatable actor based on one or more sprite images.
|
Modifier and Type | Method and Description |
---|---|
void |
act()
Empty method called in every simulation iteration.
|
void |
addActorCollisionListener(GGActorCollisionListener listener)
Registers a collision listener that reports collision events when
actors collide.
|
void |
addActorTouchListener(GGActorTouchListener listener,
int touchEventMask)
Same as addActorTouchListener(listener, touchEventMask, onTopOnly)
with onTopOnly = false.
|
void |
addActorTouchListener(GGActorTouchListener listener,
int touchEventMask,
boolean onTopOnly)
Add a GGActionTouchListener to get notifications when the touch
interacts with the actor touch area.
|
void |
addBorderListener(GGBorderListener listener)
Registers an GGBorderListener so that the callback method nearBorder() is called
when the actor's location is on a cell at the border of the game grid.
|
void |
addCollisionActor(Actor partner)
Registers a partner actor that becomes a collision candidate, e.g. that
is checked for collisions in every simulation cycle.
|
void |
addCollisionActors(java.util.ArrayList<Actor> partnerList)
Registers all actors in a list as collision candidates.
|
void |
addCollisionTile(Location location)
Registers a tile location that becomes a collision candidate, e.g. that
is checked for collisions in every simulation cycle.
|
void |
addCollisionTiles(java.util.ArrayList<Location> locationList)
Registers all tile locations in a list as collision candidates.
|
void |
addTileCollisionListener(GGTileCollisionListener listener)
Registers a tile listener that reports collision events when actors
and tiles collide.
|
int |
collide(Actor actor1,
Actor actor2)
Empty implementation of a GGActorCollisionListener called when the two actors collides.
|
int |
collide(Actor actor,
Location location)
Empty implementation of a GGTileCollisionListener called when
the an actor collides with a tile.
|
boolean |
containsPixel(android.graphics.Point pt)
Returns true, if the given point is part of the non-transparent pixels
of the current visible sprite image.
|
static void |
delay(long time)
Delay execution for the given amount of time.
|
void |
displace(double ds)
Increases the current double displace position in the
current direction to the given double distance and moves the actor
in the cell that contains the given coordinates.
|
GGBackground |
getBackground()
Returns the GGBackground reference of the actor's game grid.
|
java.util.ArrayList<Actor> |
getCollisionActors()
Returns a list of partners that are collision candidates.
|
java.util.ArrayList<Actor> |
getCollisionActorsInRange(double radius,
java.lang.Class clazz,
int spriteId)
Returns all collision candidates who belongs to a given class whose collision areas
of the image with given sprite id intersects the circle with specified radius.
|
java.util.ArrayList<Location> |
getCollisionTiles()
Returns a list of tile locations that are collision candidates.
|
android.graphics.Bitmap |
getCurrentImage()
Returns the bitmap of the currently visible sprite picture.
|
double |
getDirection()
Gets the current direction.
|
double |
getDirectionStart()
Returns the start direction.
|
PointD |
getDisplacePosition()
Returns the current displace position.
|
int |
getHeight(int spriteId)
Returns the height of the sprite with given id.
|
int |
getIdVisible()
Returns the id of the visible sprite.
|
android.graphics.Bitmap |
getImage()
Returns the bitmap of the originally loaded sprite with
id = 0.
|
android.graphics.Bitmap |
getImage(int spriteId)
Returns the bitmap of the originally loaded sprite with
given sprite id.
|
int |
getIntDirection()
Gets the current direction rounded to the next integer.
|
Location |
getLocation()
Returns the current location (horizontal and vertical coordinates).
|
android.graphics.Point |
getLocationOffset()
Returns the pixel offset in x- and y-direction relative to the current
location.
|
Location |
getLocationStart()
Returns the start location (horizontal and vertical coordinates).
|
int |
getNbCycles()
Returns the number of simulation cycles since last reset.
|
int |
getNbHorzCells()
Returns number of cells of actor's game grid in horizontal direction.
|
int |
getNbSprites()
Returns number of sprites.
|
int |
getNbVertCells()
Returns number of cells of actor's game grid in vertical direction.
|
java.util.ArrayList<Actor> |
getNeighbours(double distance)
Returns all actors in a specified distance.
|
java.util.ArrayList<Actor> |
getNeighbours(double distance,
java.lang.Class clazz)
Returns all actors of specified class in a specified distance.
|
Location |
getNextMoveLocation()
Returns the target location of the next move().
|
int |
getPixelColor(android.graphics.Point pt)
Returns the color of the currently visible sprite image at given
pixel position ((0,0) at upper left vertex, x-axis to the right,
y-axis downwards).
|
android.graphics.Point |
getPixelLocation()
Returns the location of the actor center in pixel coordinates taking
into account the current location offset (default offset is 0).
|
static android.graphics.Bitmap |
getRotatedImage(android.graphics.Bitmap bitmap,
double angle)
Deprecated.
Use GGBitmap.getRotatedImage instead.
GGBitmap.getRotatedImage(Bitmap bitmap, double angle) |
static GGVector |
getRotatedPosition(GGVector position,
android.graphics.Point center,
double angle)
Returns a new position vector of given position vector
rotated with given center point by given angle.
|
int |
getRotationIndex()
Returns the current rotation index for rotatable actors.
|
static android.graphics.Bitmap |
getScaledImage(android.graphics.Bitmap bitmap,
double factor,
double angle)
Deprecated.
Use GGBitmap.getScaledImage instead.
GGBitmap.getScaledImage(Bitmap bitmap, double factor, double angle) |
android.graphics.Bitmap |
getScaledImage(double factor,
double direction)
Same as getScaledImage(int spriteId, double factor, double direction)
with spriteId = 0.
|
android.graphics.Bitmap |
getScaledImage(int spriteId,
double factor,
double direction)
Returns the sprite image scaled by the given factor and rotated to the
given direction.
|
int |
getSlowDown()
Returns the current slow down factor.
|
int |
getWidth(int spriteId)
Returns the width of the sprite with given id.
|
int |
getX()
Returns the current horizontal coordinate.
|
int |
getXStart()
Returns the x-coordinate of the start location.
|
int |
getY()
Returns the current vertical coordinate.
|
int |
getYStart()
Returns the y-coordinate of the start location.
|
static android.graphics.Bitmap |
getZoomedImage(android.graphics.Bitmap bitmap,
double factor)
Deprecated.
Use GGBitmap.getZoomedImage instead.
GGBitmap.getZoomedImage(Bitmap bitmap, double factor) |
void |
hide()
Turns off the visiblity of this actor (all sprites are hidden, spriteId = -1).
|
boolean |
isActEnabled()
Returns true, if act() is invoked in every simulation cycle.
|
boolean |
isActorCollisionEnabled()
Returns true, if collision notification between actors is enabled.
|
boolean |
isHorzMirror()
Returns the horizontal mirroring state.
|
boolean |
isInGrid()
Returns true, if the actor's location is inside the grid.
|
boolean |
isMoveValid()
Returns true, if the next call of move() will put the actor in a cell
inside the game grid.
|
boolean |
isNearBorder()
Returns true, if the current location is on a border row or column.
|
boolean |
isRemoved()
Returns true, if the actor has been removed (by calling removeSelf() or
GameGrid.removeActor()).
|
boolean |
isRotatable()
Returns whether the actor is rotatable or not.
|
boolean |
isTileCollisionEnabled()
Returns true, if collision notification between tiles is enabled.
|
boolean |
isVertMirror()
Returns the vertical mirroring state.
|
boolean |
isVisible()
Returns true, if the actor is visible.
|
void |
move()
For a small grid (total number of cells <= 2500 = 50 * 50)
moves to one of 8 neighbour cells in the current direction (compass directions 45 degrees wide).
|
void |
move(int distance)
Moves the given distance in the current direction.
|
void |
nearBorder(Actor actor,
Location location)
Empty implementation of a BorderListener called when the actor is set into a border cell.
|
void |
removeSelf()
Removes the given actor from the scene, so that act() is not called
any more.
|
void |
reset()
Empty method called when the actor is added to the game grid,
the reset button is clicked or doReset() is called.
|
void |
rotate(Location centerLoc,
double angle)
Rotates the actor with given rotation center location by the given angle.
|
void |
rotate(android.graphics.Point center,
double angle)
Rotates the actor with given rotation center point by given angle.
|
void |
setActEnabled(boolean enable)
Enable/disable the invocation of act() in every simulation cycle.
|
void |
setActorCollisionEnabled(boolean enable)
Enable/disable the detection of collisions with the actor collision candidates.
|
void |
setActorTouchCircle(int spriteId,
android.graphics.Point center,
int radius)
Selects the circle (in pixel units) relative to the sprite image that is used for
actor touch detection.
|
void |
setActorTouchCircle(android.graphics.Point center,
int radius)
Same as setActorTouchCircle(int spriteId, Point center, int radius)
for all sprites of this actor.
|
void |
setActorTouchEnabled(boolean enable)
Enable/disable the detection of actor touch interactions.
|
void |
setActorTouchImage()
Same as setActorTouchImage(int spriteId) for all sprites of this actor.
|
void |
setActorTouchImage(int spriteId)
Selects the non-transparent pixels of the sprite image for
actor touch detection.
|
void |
setActorTouchRectangle(int spriteId,
android.graphics.Point center,
int width,
int height)
Selects the rectangle (in pixel units) relative to the sprite image that is used for
actor touch detection.
|
void |
setActorTouchRectangle(android.graphics.Point center,
int width,
int height)
Same as setActorTouchRectangle(int spriteId, Rectangle rect)
for all sprites of this actor.
|
void |
setCollisionCircle(int spriteId,
android.graphics.Point center,
int radius)
Selects the circle (in pixel units) relative to the sprite image that is used for
collision detection.
|
void |
setCollisionCircle(android.graphics.Point center,
int radius)
Same as setCollisionCircle(int spriteId, Point center, int radius)
for spriteId = 0.
|
void |
setCollisionImage()
Same as setCollisionImage(int spriteId) for spriteId = 0.
|
void |
setCollisionImage(int spriteId)
Selects collision detection on non-transparent pixels of the image.
|
void |
setCollisionLine(int spriteId,
android.graphics.Point startPoint,
android.graphics.Point endPoint)
Selects the line segment (in pixel units) relative to the sprite image that is used for
collision detection.
|
void |
setCollisionLine(android.graphics.Point startPoint,
android.graphics.Point endPoint)
Same as setCollisionLine(int spriteId, Point startPoint, Point endPoint)
for spriteId = 0.
|
void |
setCollisionRectangle(int spriteId,
android.graphics.Point center,
int width,
int height)
Selects the rectangle (in pixel units) relative to the sprite image that is used for
collision detection.
|
void |
setCollisionRectangle(android.graphics.Point center,
int width,
int height)
Same as setCollisionRectangle(int spriteId, Point center, int width, int height)
for spriteId = 0
|
void |
setCollisionSpot(int spriteId,
android.graphics.Point spot)
Selects the hot spot (in pixel units) relative to the sprite image that is used for
collision detection.
|
void |
setCollisionSpot(android.graphics.Point spot)
Same as setCollisionSpot(int spriteId, Point spot)
for spriteId = 0.
|
void |
setDirection(double direction)
Sets the moving direction.
|
void |
setDirection(Location.CompassDirection compassDir)
Sets the moving direction to the given compass direction.
|
void |
setDisplacePosition(PointD displacePosition)
Sets the current displace position and moves the actor in the cell that
contains the given coordinates.
|
void |
setHorzMirror(boolean enable)
If set, the sprite image shown is mirrored horizontally.
|
void |
setLocation(Location location)
Assigns a new current location.
|
void |
setLocationOffset(int x,
int y)
Same as setLoctionOffset(Point locationOffset) with given x and
y displacements.
|
void |
setLocationOffset(android.graphics.Point locationOffset)
Sets a pixel offset in x- any y-direction relative to the current
location.
|
void |
setOnBottom()
Sets the actor at the last place in the scene of the actor's class.
|
void |
setOnTop()
Sets the actor at the first place in the scene of the actor's class.
|
void |
setPixelLocation(android.graphics.Point imageCenter)
Moves the center of the actor to the given pixel coordinates.
|
void |
setSlowDown(int factor)
Slows down the calling of act() by the given factor.
|
void |
setTileCollisionEnabled(boolean enable)
Enable/disable the detection of collisions with the tile collision candidates.
|
void |
setVertMirror(boolean enable)
If set, the sprite image shown is mirrored vertically.
|
void |
setX(int x)
Assigns a new current horizontal cell coordinate.
|
void |
setY(int y)
Assigns a new current vertical cell coordinate.
|
void |
show()
Turns on the visibility of the sprite with id 0.
|
void |
show(int spriteId)
Turns on the visibility of the sprite with given id.
|
void |
showNextSprite()
Increases the id of the currently visible sprite and makes this
sprite visible.
|
void |
showPreviousSprite()
Decreases the id of the currently visible sprite and makes this
sprite visible.
|
void |
turn(double angle)
Turns the moving direction by the given angle (clockwise for positive
angles, counterclockwise for negative angles).
|
public GameGrid gameGrid
public int nbCycles
public Actor(android.graphics.Bitmap... spriteImages)
spriteImages
- references to Bitmaps that contains the sprite imagespublic Actor(boolean isRotatable, android.graphics.Bitmap spriteImage)
isRotatable
- if true, the actor's image may be rotated when the direction changesspriteImage
- reference to a Bitmap that contains the sprite imagepublic Actor(boolean isRotatable, android.graphics.Bitmap... spriteImages)
isRotatable
- if true, the actor's image may be rotated when the direction changesspriteImages
- references to Bitmaps that contains the sprite imagespublic Actor()
public Actor(java.lang.String filename)
filename
- the path or URL to the image file displayed for this actorpublic Actor(java.lang.String... filenames)
filenames
- the paths or URLs (one or more) to the image files displayed for this actorpublic Actor(boolean isRotatable, java.lang.String filename)
isRotatable
- if true, the actor's image may be rotated when the direction changesfilename
- the path to the image file displayed for this actorpublic Actor(boolean isRotatable, java.lang.String... filenames)
isRotatable
- if true, the actor's image may be rotated when the direction changesfilenames
- the paths or URLs to the image files displayed for this actorpublic Actor(java.lang.String filename, int nbSprites)
filename
- the fully qualified path to the image file displayed for this actornbSprites
- the number of sprite images for the same actorpublic Actor(boolean isRotatable, java.lang.String filename, int nbSprites)
isRotatable
- if true, the actor's image may be rotated when the direction changesfilename
- the path or URL to the image file displayed for this actornbSprites
- the number of sprite images for the same actorpublic void setLocationOffset(android.graphics.Point locationOffset)
locationOffset
- x,y displacement (x to the left, y downwards)public void setLocationOffset(int x, int y)
x
- displacement (positive x to the left)y
- displacement (positive y to downwards)public android.graphics.Point getLocationOffset()
public GGBackground getBackground()
public void setX(int x)
x
- the x-coordinate (cell index)public void setY(int y)
y
- the y-coordinate (cell index)public void setLocation(Location location)
location
- the new location (value copy)public void setPixelLocation(android.graphics.Point imageCenter)
imageCenter
- the pixel coordinates of the image centerpublic int getX()
public int getY()
public Location getLocation()
public Location getLocationStart()
public int getXStart()
public int getYStart()
public double getDirectionStart()
public void setDirection(double direction)
direction
- the angle for the next movement (in degrees clockwise, 0 to east)public void setDirection(Location.CompassDirection compassDir)
compassDir
- the compass dirction for the next movementpublic int getRotationIndex()
public double getDirection()
public int getIntDirection()
public Location getNextMoveLocation()
public void move()
public void move(int distance)
distance
- the distance to the requested cell location in cell units.public int getNbHorzCells()
public int getNbVertCells()
public void turn(double angle)
angle
- the angle to turn in degreespublic void act()
public void reset()
public void addBorderListener(GGBorderListener listener)
listener
- the GGBorderListener to registerpublic void nearBorder(Actor actor, Location location)
nearBorder
in interface GGBorderListener
actor
- the current actorlocation
- the border locationpublic boolean isInGrid()
public boolean isNearBorder()
public boolean isMoveValid()
public void removeSelf()
public void setSlowDown(int factor)
factor
- the factor greater or equal to 1 for delaying the
invocation of act()public int getSlowDown()
public void show()
public void show(int spriteId)
spriteId
- the sprite id that will become visible; visibility
remains unchanged if spriteId is less than zero or greater or equal to
the number of spritespublic void hide()
public int getIdVisible()
public boolean isVisible()
public void addCollisionActor(Actor partner)
partner
- the partner that is checked for collisionpublic int collide(Actor actor1, Actor actor2)
collide
in interface GGActorCollisionListener
actor1
- the first actoractor2
- the second actorpublic int collide(Actor actor, Location location)
collide
in interface GGTileCollisionListener
actor
- the colliding actorlocation
- the location of the colliding tile within the tile mappublic void addCollisionActors(java.util.ArrayList<Actor> partnerList)
partnerList
- a list of actors that are checked for collisionpublic java.util.ArrayList<Actor> getCollisionActors()
public void addCollisionTile(Location location)
location
- the location of the tile within the tile mappublic void addCollisionTiles(java.util.ArrayList<Location> locationList)
locationList
- a list of tile locations that are checked for collisionpublic java.util.ArrayList<Location> getCollisionTiles()
public void addActorCollisionListener(GGActorCollisionListener listener)
listener
- an actor collision listener; null to disable eventspublic void addTileCollisionListener(GGTileCollisionListener listener)
listener
- a tile collision listener; null to disable eventspublic void setHorzMirror(boolean enable)
enable
- if true, horizontal mirroring is enabledpublic void setVertMirror(boolean enable)
enable
- if true, vertical mirroring is enabledpublic boolean isHorzMirror()
public boolean isVertMirror()
public void setActEnabled(boolean enable)
enable
- if true, act() is invoked; otherwise act() is not invokedpublic boolean isActEnabled()
public void setActorCollisionEnabled(boolean enable)
enable
- if true (default), collisions will be notifiedpublic boolean isActorCollisionEnabled()
public void setTileCollisionEnabled(boolean enable)
enable
- if true (default), collisions will be notifiedpublic boolean isTileCollisionEnabled()
public java.util.ArrayList<Actor> getCollisionActorsInRange(double radius, java.lang.Class clazz, int spriteId)
radius
- the radius of the circle around the center of the current location in (fractional) cell unitsclazz
- the clazz the actors must belong to, if null, all actors are consideredpublic java.util.ArrayList<Actor> getNeighbours(double distance, java.lang.Class clazz)
distance
- the distance in (fractional) cell units publicclazz
- the class of the actors to look for; if null actors of all classes are includedpublic java.util.ArrayList<Actor> getNeighbours(double distance)
distance
- the distance in (fractional) cell units publicpublic boolean isRotatable()
public void setCollisionRectangle(int spriteId, android.graphics.Point center, int width, int height)
spriteId
- the id of the spritecenter
- the rectangle center (zero at image center)width
- the width in pixel units of the rectangle (in x-direction)height
- the height in pixel units of the rectangle (in y-direction)public void setCollisionRectangle(android.graphics.Point center, int width, int height)
center
- the rectangle center (zero at image center)width
- the width in pixel units of the rectangle (in x-direction)height
- the height in pixel units of the rectangle (in y-direction)public void setCollisionCircle(int spriteId, android.graphics.Point center, int radius)
spriteId
- the id of the spritecenter
- circle center (zero at image center)radius
- the radius of the circle (in pixel units)public void setCollisionCircle(android.graphics.Point center, int radius)
center
- the circle center (zero at image center)radius
- the radius of the circle (in pixel units)public void setCollisionLine(int spriteId, android.graphics.Point startPoint, android.graphics.Point endPoint)
spriteId
- the id of the spritestartPoint
- the start point of the line (zero at image center)endPoint
- the end point of the line (zero at image center)public void setCollisionLine(android.graphics.Point startPoint, android.graphics.Point endPoint)
startPoint
- the start point of the line (zero at image center)endPoint
- the end point of the line (zero at image center)public void setCollisionSpot(int spriteId, android.graphics.Point spot)
spriteId
- the id of the spritespot
- the hot spot (zero at image center)public void setCollisionSpot(android.graphics.Point spot)
spot
- the hot spot (zero at image center)public void setCollisionImage(int spriteId)
spriteId
- the id of the spritepublic void setCollisionImage()
public void setOnTop()
public void setOnBottom()
public int getNbCycles()
public static void delay(long time)
time
- the delay time (in ms)public void showNextSprite()
public void showPreviousSprite()
public android.graphics.Bitmap getCurrentImage()
public android.graphics.Bitmap getImage(int spriteId)
public android.graphics.Bitmap getImage()
public int getPixelColor(android.graphics.Point pt)
pt
- the point where to look for the colorpublic android.graphics.Point getPixelLocation()
setLocationOffset(Point locationOffset)
public int getWidth(int spriteId)
spriteId
- the id of the spritepublic int getHeight(int spriteId)
spriteId
- the id of the spritepublic static GGVector getRotatedPosition(GGVector position, android.graphics.Point center, double angle)
position
- the vector to the current positioncenter
- the rotation center pointangle
- the rotating angle (in degrees, positive clockwise)public void rotate(Location centerLoc, double angle)
centerLoc
- the rotation center locationangle
- the rotation angle (in degrees, positive clockwise)public void rotate(android.graphics.Point center, double angle)
center
- the rotation center pointangle
- the rotation angle (in degrees, positive clockwise)public void addActorTouchListener(GGActorTouchListener listener, int touchEventMask)
listener
- the GGActorTouchListener to registertouchEventMask
- an OR-combinaton of constants defined in class GGTouchpublic void addActorTouchListener(GGActorTouchListener listener, int touchEventMask, boolean onTopOnly)
listener
- the GGActorTouchListener to registertouchEventMask
- an OR-combinaton of constants defined in class GGTouchonTopOnly
- if true, enable actor touch event for the actor at top of others
(painted last) only; otherwise touch event of all actors is enabledpublic void setActorTouchRectangle(int spriteId, android.graphics.Point center, int width, int height)
spriteId
- the id of the spritecenter
- the rectangle center (zero at image center)width
- the width in pixel units of the rectangle (in x-direction)height
- the height in pixel units of the rectangle (in y-direction)public void setActorTouchRectangle(android.graphics.Point center, int width, int height)
center
- the rectangle center (zero at image center)width
- the width in pixel units of the rectangle (in x-direction)height
- the height in pixel units of the rectangle (in y-direction)public void setActorTouchCircle(int spriteId, android.graphics.Point center, int radius)
spriteId
- the id of the spritecenter
- circle center (zero at image center)radius
- the radius of the circle (in pixel units)public void setActorTouchCircle(android.graphics.Point center, int radius)
center
- circle center (zero at image center)radius
- the radius of the circle (in pixel units)public void setActorTouchImage(int spriteId)
public void setActorTouchImage()
public void setActorTouchEnabled(boolean enable)
enable
- if true, actor touch interactions will be notified@Deprecated public static android.graphics.Bitmap getZoomedImage(android.graphics.Bitmap bitmap, double factor)
GGBitmap.getZoomedImage(Bitmap bitmap, double factor)
bitmap
- the original sprite image bitmapfactor
- the zoom factor (>1 zoom-in, <1 zoom-out)@Deprecated public static android.graphics.Bitmap getRotatedImage(android.graphics.Bitmap bitmap, double angle)
GGBitmap.getRotatedImage(Bitmap bitmap, double angle)
bitmap
- the original sprite image bitmapangle
- the rotation angle (in degrees clockwise)@Deprecated public static android.graphics.Bitmap getScaledImage(android.graphics.Bitmap bitmap, double factor, double angle)
GGBitmap.getScaledImage(Bitmap bitmap, double factor, double angle)
bitmap
- the original sprite image bitmapfactor
- the zoom factor (>1 zoom-in, <1 zoom-out)angle
- the rotation angle (in degrees clockwise)public android.graphics.Bitmap getScaledImage(int spriteId, double factor, double direction)
spriteId
- the sprite id of the actor's sprite imagefactor
- the zoom factor (>1 zoom-in, <1 zoom-out)direction
- the rotation angle (in degrees clockwise, 0 to east)public android.graphics.Bitmap getScaledImage(double factor, double direction)
factor
- the zoom factor (>1 zoom-in, <1 zoom-out)public int getNbSprites()
public boolean isRemoved()
public void displace(double ds)
ds
- the distance to displace the actor; if negative, displace in
opposite directionpublic PointD getDisplacePosition()
public void setDisplacePosition(PointD displacePosition)
displacePosition
- the double coordinates of the new positionpublic boolean containsPixel(android.graphics.Point pt)
pt
- the pixel coordinates of the point