Aw object select

From ActiveWiki
Jump to: navigation, search
Minimum requirements
Added in version 2.2
SDKbuild 14
Worldbuild 21
Browserbuild 296


int aw_object_select (void)

Description

Simulates selecting an object.

Callback

None (returns immediately)

Notes

This method triggers AW_EVENT_OBJECT_SELECT in all the neighbor SDK applications that have subscribed to the event. It is intended for use by the Active Worlds Browser to indicate when a user selects an object (by right-clicking on it with the mouse). However it is also available for use by SDK applications which may wish to simulate user mouse actions for the purposes of testing, etc.

The object to be selected can be specified in two ways. This is the old method for doing it:

There is also new method which was introduced in version 4.1:

Arguments

None

Argument attributes

AW_OBJECT_X
AW_OBJECT_Z
AW_OBJECT_NUMBER
AW_OBJECT_ID

Return values

RC_SUCCESS
RC_NOT_INITIALIZED
RC_NO_INSTANCE
RC_NO_CONNECTION
The connection to the world is down.

Returned attributes

None

Usage

Simulate a right-click on an object.

void select_object (int x, int z, int number)
{
  int  rc;
  
  aw_int_set (AW_OBJECT_ID, 0);
  aw_int_set (AW_OBJECT_NUMBER, number);
  aw_int_set (AW_OBJECT_X, x);
  aw_int_set (AW_OBJECT_Z, z);
  
  rc = aw_object_select ();
  if (rc != RC_SUCCESS)
    printf ("Object select failed (reason %d)\n", rc);
}

See also