AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.entityshapes.ps.BitmapPic Class Reference
Inheritance diagram for game2dai.entityshapes.ps.BitmapPic:

Public Member Functions

 BitmapPic (PApplet papp, String fname)
 
 BitmapPic (PApplet papp, String fname, int nCols, int nRows)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float etime)
 
void setAnimation (double interval, int dir)
 
void pauseAnimation ()
 
- Public Member Functions inherited from game2dai.entityshapes.ps.PicturePS
 PicturePS ()
 
 PicturePS (PApplet papp)
 
void setApplet (PApplet app)
 
- Public Member Functions inherited from game2dai.entityshapes.Picture
 Picture ()
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float elapsedTime)
 
void showHints (int hints)
 
void addHints (int hints)
 
void removeHints (int hints)
 
void removeAllHints ()
 
int getHints ()
 

Package Attributes

PImage[] img
 
final int FORWARD = 1
 
final int PAUSE = 0
 
final int REVERSE = -1
 
double timeToChangeFrame = 0
 
double intervalTime = 0
 
int dir = PAUSE
 
int interval = 0
 
int frameNo = 0
 

Additional Inherited Members

- Protected Attributes inherited from game2dai.entityshapes.ps.PicturePS
PApplet app = null
 
- Protected Attributes inherited from game2dai.entityshapes.Picture
int hints = 0
 

Detailed Description

A single image or a sprite sheet is used to render the entity. If a sprite sheet is used then they can be used to animate the rendered entity.

Author
Peter Lager

Constructor & Destructor Documentation

◆ BitmapPic() [1/2]

game2dai.entityshapes.ps.BitmapPic.BitmapPic ( PApplet  papp,
String  fname 
)

Single image for all frames

Parameters
papp
fnamethe name of the bitmap image file

◆ BitmapPic() [2/2]

game2dai.entityshapes.ps.BitmapPic.BitmapPic ( PApplet  papp,
String  fname,
int  nCols,
int  nRows 
)

An animated image.
The image frames are stored as tiles within a single image

Parameters
papp
fnamethe name of the bitmap image file
nColsnumber of tiles horizontally
nRowsnumber of rows vertically

Member Function Documentation

◆ draw()

void game2dai.entityshapes.ps.BitmapPic.draw ( BaseEntity  owner,
float  posX,
float  posY,
float  velX,
float  velY,
float  headX,
float  headY,
float  etime 
)

Draw the entity.

Parameters
ownerthe entity that owns this renderer.
posXreal world position (x)
posYreal world position (x)
velXmagnitude of the velocity vector in the x direction
velYmagnitude of the velocity vector in the y direction
headXmagnitude of the heading vector in the x direction
headYmagnitude of the heading vector in the y direction
etimethe elapsed time in seconds since last update

Reimplemented from game2dai.entityshapes.Picture.


The documentation for this class was generated from the following file: