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

Public Member Functions

 PersonPic (PApplet papp)
 
 PersonPic (PApplet papp, float size)
 
 PersonPic (PApplet papp, float size, int bodyFill, int headFill, int stroke, float weight)
 
PersonPic appearance (int bodyFill, int headFill, int stroke, float weight)
 
void bodyFill (int col)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float etime)
 
- 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 ()
 

Private Member Functions

void fillTriangle (int p1, int p2)
 

Private Attributes

float headSize
 
float[] x = new float[] {-0.5f, 0.2f, 0.2f, -0.5f}
 
float[] y = new float[] {0.6f, 1.0f, -1.0f, -0.6f}
 
int bodyFillCol = 255
 
int headFillCol = 255
 
int strokeCol = 0
 
float strokeWeight = 1.0f
 

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 simple representation of a person viewed from above.
The drawing is more complicated so that it will work in all renderers.

Author
Peter Lager

Constructor & Destructor Documentation

◆ PersonPic() [1/3]

game2dai.entityshapes.ps.PersonPic.PersonPic ( PApplet  papp)

Create a person of size 10 with a white body, grey head and thin black border.

Parameters
papp

◆ PersonPic() [2/3]

game2dai.entityshapes.ps.PersonPic.PersonPic ( PApplet  papp,
float  size 
)

Create a person of size 10 with a white body, grey head and thin black border.

Parameters
papp
sizethe overall size (|2x collision radius)

◆ PersonPic() [3/3]

game2dai.entityshapes.ps.PersonPic.PersonPic ( PApplet  papp,
float  size,
int  bodyFill,
int  headFill,
int  stroke,
float  weight 
)

Create a person of user defined size and colours.

Parameters
papp
sizethe overall size (|2x collision radius)
bodyFillshoulder colour
headFillhead colour
strokeedge colour
weightedge thickness

Member Function Documentation

◆ appearance()

PersonPic game2dai.entityshapes.ps.PersonPic.appearance ( int  bodyFill,
int  headFill,
int  stroke,
float  weight 
)

Create a person of user defined size and colours.

Parameters
bodyFillshoulder colour
headFillhead colour
strokeedge colour
weightedge thickness

◆ bodyFill()

void game2dai.entityshapes.ps.PersonPic.bodyFill ( int  col)

Sometimes you might only want to change the body colour.

Parameters
colnew colour for body (shoulders)

◆ draw()

void game2dai.entityshapes.ps.PersonPic.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: