IAgentCharacter::MoveTo
HRESULT MoveTo(
short x, // x-coordinate of new location
short y, // y-coordinate of new location
long lSpeed, // speed to move the character
long * pdwReqID // address of request ID
);
Plays the associated Moving state animation and moves the character frame to the specified location.
- Returns S_OK to indicate the operation was successful. When the function returns, this variable contains the ID of the request.
- x
- The x-coordinate of the new position in pixels, relative to the screen origin (upper left). The location of a character is based on the upper left corner of its animation frame.
- y
- The y-coordinate of the new position in pixels, relative to the screen origin (upper left). The location of a character is based on the upper left corner of its animation frame.
- lSpeed
- A parameter specifying in milliseconds how quickly the character's frame moves. The recommended value is 1000. Specifying zero (0) moves the frame without playing an animation.
- pdwReqID
- Address of a variable that receives the MoveTo request ID.
When using the HTTP protocol to access character and animation data, use the Prepare method to ensure the availability of the Moving state animations before calling this method. Even if the animation is not loaded, the server still moves the frame.
See Also
IAgentCharacter::SetPosition