Rik's Treehouse > Babbling in Binary > My Software > Orphanware > R2DToo > R2DToo Help > For the Programmer > getAgentHint

getAgentHint

Declaration
Parameters
Return Value
Remarks
Revisions
Example
See Also

Declaration

char* __stdcall getAgentHint(
    int x,        // x-coordinate of agent
    int y,        // y-coordinate of agent
    pState state  // array of agent state variables
);
Top of page

Parameters

x,y
Coordinates of agent.
state
Array of agent state variables.
Top of page

Return Value

A character string returning information to be displayed in hint box when the user hovers mouse over an agent. Top of page

Remarks

This optional function may be provided by the model. It is called when the user hovers the mouse cursor over an agent in the view portal. This function should return a brief character string providing information about the agent.
Top of page

Revisions

API v1.6
  • new!
Top of page

Example

char* __stdcall getAgentHint(int x, int y, pState state) { char buffer[256] = ""; // return position and "Alive" if state[0]>0 else "Dead" sprintf(buffer,"(%d,%d) %s",x,y, (state[0] ? "Alive" : "Dead")); return &buffer[0]; } Top of page

See Also

getAgentAbout.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:38pm