Extensions |
The MMFI Object API is able to discern between different kinds of objects (where 'kind' here refers to a unique MFX extension file, not a unique instance of said extension). When creating a new object, this allows the module to only add the fields and methods that are compatible with it. The API only has limited support for object-specific functionality, so most objects will only support the functionality that is common to all objects. That functionality is documented below.
Common Object Fields
These fields can be read from or written to directly, and are supported by all objects.
number | x | Object's X coordinate in pixels |
number | y | Object's Y coordinate in pixels |
number | layer |
Object's layer (limited support) |
Common Object Fields (Read-Only)
These fields can be accessed, but not updated.
object | class | Reference to object's associated Class object |
number | classID | Object's instance identifier (shared by all creation instances of object) |
string | className | Object's instance name (as defined in the frame editor) |
number | fixed | Object's unqiue fixed value (unique to every creation instance) |
number | height | Object's height in pixels |
number | hotX | X coordinate of object's hotspot, relative to object origin |
number | hotY | Y coordinate of object's hotspot, relative to object origin |
number | type | Object's extension id (unique to each MFX extension file) |
number | width | Object's width in pixels |
number | xLeft | X coordinate of left edge of object |
number | xRight | X coordinate of right edge of object |
number | yBottom |
Y coordinate of bottom edge of object |
number | yTop | Y coordinate of top edge of object |
Common Object Methods
These methods may be called by any object. They are protected, so they cannot be overwritten. The colon operator, which is used by most Lua object tables, is optional here. Click on each function for more information.
void | destroy() |
Example
Copyright 2010 Justin Aquadro