ObjectInterface
This class exposes most object properties and manipulator methods.
You can set any field of this class to an RValue, and it'll be the same as setting a variable for every instance of this object.
Example
Name
Type: string
The name of the object. Writing to this field will overwrite the object's name.
Parent
Type: ObjectInterface
The parent of the object. nil if none is present.
Flags
Type: int (bits)
The flags of the object.
Sprite
Type: int
The sprite index for the object. Writing to this field will overwrite the object's sprite.
Depth
Type: int
The depth for the object. Writing to this field will overwrite the object's depth.
Mask
Type: int
The mask of the object.
ID
Type: int
The ID of the object.
Spawn
Spawns the object in the current room.
Arguments
Name | Type | Description |
---|---|---|
|
| The X coordinate of the object's position. |
|
| The Y coordinate of the object's position. |
|
| The name of the layer to spawn the object in. See remarks for more information. |
|
| The index of the room to spawn the object in. See remarks for more information. |
Remarks
layer
Default: 0 (int
).
This parameter is ignored if the second optional parameter, room
, is defined.
room
Default: current room.
Including this parameter will place the object inside the target room at X
, Y
and override the layer to be 0 (int
).
Destroy
Destroys the last instance of the object in the current room.
Arguments
None
GetInstances
Get a table of all object instances in the current room.
Arguments
None
Returns
Type | Description |
---|---|
| The instances of the object in the current rom. |