A map object: something that’s not placed on the fixed grid
Has several subclasses.
Can be either a “tile object”, which has an associated tile much like a map-tile, or a regular (non-tile) object that has a settable size.
init arguments, which become attributes:
- layer¶
The layer this object is on
- pixel_pos¶
The pixel coordinates
- pixel_size¶
Size of this object, as a (width, height) tuple, in pixels.
Only one of pixel_size and size may be specified.
- size¶
Size of this object, as a (width, height) tuple, in units of map tiles.
- name¶
Name of the object. A string (or unicode)
- type¶
Type of the object. A string (or unicode). No semantics attached.
Other attributes:
Unpacked position attributes:
Methods:
A rectangle object, either blank (sized) or a tile object
See MapObject for inherited members.
Extra init arguments, which become attributes:
- pixel_size¶
Size of this object, as a (width, height) tuple, in pixels. Must be specified for non-tile objects, and must not be specified for tile objects (unless the size matches the tile).
Similar restrictions apply to setting the property (and width & height).
- size¶
Size of this object, as a (width, height) tuple, in units of map tiles.
Shares setting restrictions with pixel_size. Note that the constructor will nly accept one of size or pixel_size, not both at the same time.
- value¶
Value of the tile, if it’s a tile object.
See tmxlib.tile.TileLikeObject for attributes and methods shared with tiles.
An ellipse object
Extra init arguments, which become attributes:
- pixel_size¶
Size of this object, as a (width, height) tuple, in pixels. Must be specified for non-tile objects, and must not be specified for tile objects (unless the size matches the tile).
Similar restrictions apply to setting the property (and width & height).
- size¶
Size of this object, as a (width, height) tuple, in units of map tiles.
Shares setting restrictions with pixel_size. Note that the constructor will nly accept one of size or pixel_size, not both at the same time.
Unpacked size attributes:
A polygon object
See MapObject for inherited members.
Extra init arguments, which become attributes:
- points¶
Size of this object, as a (width, height) tuple, in pixels. Must be specified for non-tile objects, and must not be specified for tile objects (unless the size matches the tile).
The format is list of iterables: [(x0, y0), (x1, y1), ..., (xn, yn)]
A polygon object
Behaves just like PolygonObject, it’s not closed when drawn. Has the same points attribute/argument as PolygonObject.