AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.entityshapes.Picture Class Referenceabstract
Inheritance diagram for game2dai.entityshapes.Picture:

Public Member Functions

 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 ()
 

Protected Attributes

int hints = 0
 

Detailed Description

Any class to be used to render an entity on the screen should inherit from this class.
It provides a simple way to display steering behaviour hints for any entity renderer. This is particularly useful when it comes to testing your steering behaviours.
Hints available are
HINT_HEADING the direction the entity is facing
HINT_VELOCITY the velocity vector
HINT_COLLISION the collision radius
HINT_WHISKERS the feelers used in wall avoidance
HINT_OBS_AVOID the detection box used in obstacle avoidance
HINT_WANDER the wander direction and circle
HINT_VIEW the area that can be seen by the entity

When setting the hints to be shown they can be or'ed together e.g. Hints.HINT_HEADING | hints.HINT_VELOCITY

Author
Peter Lager

Constructor & Destructor Documentation

◆ Picture()

game2dai.entityshapes.Picture.Picture ( )

This constructor is provided when not using Processing.

Member Function Documentation

◆ addHints()

void game2dai.entityshapes.Picture.addHints ( int  hints)

Add more steering behaviour (SB) hints to those already selected.

Parameters
hints

◆ draw() [1/2]

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

DO NOT USE THIS METHOD
This method is left to ensure backward compatibility with library versions prior to 1.0

Use the draw method with the extra parameter for elapsed time.

◆ draw() [2/2]

void game2dai.entityshapes.Picture.draw ( BaseEntity  owner,
float  posX,
float  posY,
float  velX,
float  velY,
float  headX,
float  headY,
float  elapsedTime 
)

This method must be overridden in all child classes otherwise nothing is drawn.
This version of the draw method has an additional parameter for the elpased time since last update and will be called will be called by the

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 in game2dai.entityshapes.ps.ArrowPic, game2dai.entityshapes.ps.BitmapPic, game2dai.entityshapes.ps.BuildingPic, game2dai.entityshapes.ps.CirclePic, game2dai.entityshapes.ps.ObstaclePic, game2dai.entityshapes.ps.PersonPic, game2dai.entityshapes.ps.Umbrella, and game2dai.entityshapes.ps.WallPic.

◆ getHints()

int game2dai.entityshapes.Picture.getHints ( )

Get the hints being currently used.

◆ removeAllHints()

void game2dai.entityshapes.Picture.removeAllHints ( )

Remove all steering behaviour (SB) hints.

◆ removeHints()

void game2dai.entityshapes.Picture.removeHints ( int  hints)

Remove some or all of the steering behaviour (SB) hints currently selected.

Parameters
hints

◆ showHints()

void game2dai.entityshapes.Picture.showHints ( int  hints)

Defines the steering behaviour (SB) hints to be displayed.
Although you can specify any and all hints, only hints for SBs currently in use will be displayed.
This method replaces any existing SB hints.

Parameters
hints

Member Data Documentation

◆ hints

int game2dai.entityshapes.Picture.hints = 0
protected

bit flag defining hints to be displayed


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