![]() ![]() Unique ID of the object as a string if set, or None Object ( name, type_, x, y, width=0, height=0, rotation=0, gid=None, visible=True, properties=None, ellipse=False, polygon=None, polyline=None, id_=None ) ¶ id ¶ Whether or not the tile is flipped diagonally (X and Y axis Whether or not the tile is flipped vertically. Whether or not the tile is flipped horizontally. LayerTile ( gid, hflip=False, vflip=False, dflip=False ) ¶ gid ¶ Exactly how the tiles are positioned isĭetermined by the map orientation. The coordinates of each tile is determined by the tile’s index properties ¶Ī list of LayerTile objects indicating the tiles of the Rendering offset for this layer in pixels. The opacity of the layer as a value from 0 to 1. Layer ( name, opacity=1, visible=True, offsetx=0, offsety=0, properties=None, tiles=None ) ¶ name ¶ properties ¶Ī list of Property objects indicating the properties ofĪn Image object indicating the image of the image layer. Whether or not the image layer is visible. The opacity of the image layer as a value from 0 to 1. The y position of the image layer in pixels. The x position of the image layer in pixels. ImageLayer ( name, offsetx, offsety, opacity=1, visible=True, properties=None, image=None ) ¶ name ¶ The image data if embedded, or None if an external image The height of the image in pixels used for tile index correction The width of the image in pixels used for tile index correction Image, or None if no color is treated as transparent. trans ¶Ī Color object indicating the transparent color of the The location of the image file referenced. Should be anĮxtension like "png", "gif", "jpg", or "bmp". Indicates the format of image data if embedded. Image ( format_=None, source=None, trans=None, width=None, height=None, data=None ) ¶ format ¶ The format of the string is either "#RRGGBB" or The hex string representation of the color used by the TMX file. Indicates full transparency and 255 indicates full opacity. The alpha transparency of the color as an integer, where 0 Indicates no blue intensity and 255 indicates full blue The blue component of the color as an integer, where 0 Indicates no green intensity and 255 indicates full green The green component of the color as an integer, where 0 Indicates no red intensity and 255 indicates full red The red component of the color as an integer, where 0 Used on layers if possible (currently only possible for data_compression – Whether or not compression should be.data_encoding – The encoding to use for layers.Save the object to the file with the indicated name. save ( fname, data_encoding='base64', data_compression=True ) ¶ Load the TMX file with the indicated name and return a In this list first are rendered first (i.e. Object groups, and image layers, respectively. ImageLayer objects indicating the map’s tile layers, Set to None toĪ list of Property objects indicating the map’sĪ list of Tileset objects indicating the map’s tilesets. Map, or None if no background color is defined. backgroundcolor ¶Ī Color object indicating the background color of the ![]() Side length of the hexagon in hexagonal tiles. Only meaningful for staggered and hexagonal maps. Only meaningful for staggered andĭetermines what indexes along the staggered axis are shifted.Ĭan be “even” or “odd”. tilewidth ¶ĭetermines which axis is staggered. Can be “orthogonal”, “isometric”, “staggered”, This class loads, stores, and saves TMX files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |