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

Public Member Functions

 ArrowPic (PApplet papp)
 
 ArrowPic (PApplet papp, float length, int fill, int stroke, float weight)
 
void draw (BaseEntity owner, float posX, float posY, float velX, float velY, float headX, float headY, float etime)
 
ArrowPic appearance (int fill, int stroke, float weight)
 
- 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 Attributes

float arrowLength = 20
 
float[] x = new float[] {0.5f * arrowLength, -0.4f * arrowLength, -0.4f * arrowLength}
 
float[] y = new float[] {0, 0.3f * arrowLength, -0.3f * arrowLength}
 
int fillCol
 
int strokeCol
 
float strokeWeight
 

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

Creates an triangular shape that looks like an arrow.

Author
Peter Lager

Constructor & Destructor Documentation

◆ ArrowPic() [1/2]

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

Create an arrow 20 units long and 12 units at its thick end with a white body and thin black border.

Parameters
papp

◆ ArrowPic() [2/2]

game2dai.entityshapes.ps.ArrowPic.ArrowPic ( PApplet  papp,
float  length,
int  fill,
int  stroke,
float  weight 
)

Create an arrow of user specified length and colours.

Parameters
papp
lengththe length of the arrow
fillthe fill colour
strokethe border colour
weightthe border thicknesss

Member Function Documentation

◆ appearance()

ArrowPic game2dai.entityshapes.ps.ArrowPic.appearance ( int  fill,
int  stroke,
float  weight 
)

Cahneg the appearance of the arrow

Parameters
fillthe fill colour
strokethe border colour
weightthe border thicknesss

◆ draw()

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