diff --git a/docs/api/common_types.rst b/docs/api/common_types.rst
index c49c929..d6f45e3 100644
--- a/docs/api/common_types.rst
+++ b/docs/api/common_types.rst
@@ -8,17 +8,17 @@ to get the same values, or you can reference them by name. The values shown here
will be in the final tuple.
-pytiled_parser.Color
-^^^^^^^^^^^^^^^^^^^^
+Color
+^^^^^
-.. autoclass:: pytiled_parser.Color
+.. autoclass:: pytiled_parser.common_types.Color
-pytiled_parser.OrderedPair
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+OrderedPair
+^^^^^^^^^^^
-.. autoclass:: pytiled_parser.OrderedPair
+.. autoclass:: pytiled_parser.common_types.OrderedPair
-pytiled_parser.Size
-^^^^^^^^^^^^^^^^^^^
+Size
+^^^^
-.. autoclass:: pytiled_parser.Size
\ No newline at end of file
+.. autoclass:: pytiled_parser.common_types.Size
\ No newline at end of file
diff --git a/docs/api/index.rst b/docs/api/index.rst
index 26aee22..d1ce3b8 100644
--- a/docs/api/index.rst
+++ b/docs/api/index.rst
@@ -15,6 +15,12 @@ cover some of the concepts surrounding that module and it's usage within Tiled.
:maxdepth: 1
:caption: PyTiled Parser
+ parser
common_types
properties
+ tileset
layer
+ objects
+ map
+ wang_set
+ world
diff --git a/docs/api/layer.rst b/docs/api/layer.rst
index 640d1e9..6766538 100644
--- a/docs/api/layer.rst
+++ b/docs/api/layer.rst
@@ -11,38 +11,38 @@ and serves only as an abstract base for common elements between all types.
For more information about Layers, see `Tiled's Manual `_
-pytiled_parser.Layer
-^^^^^^^^^^^^^^^^^^^^
+Layer
+^^^^^
-.. autoclass:: pytiled_parser.Layer
+.. autoclass:: pytiled_parser.layer.Layer
:members:
-pytiled_parser.TileLayer
-^^^^^^^^^^^^^^^^^^^^^^^^
+TileLayer
+^^^^^^^^^
-.. autoclass:: pytiled_parser.TileLayer
+.. autoclass:: pytiled_parser.layer.TileLayer
:members:
-pytiled_parser.Chunk
-^^^^^^^^^^^^^^^^^^^^
+Chunk
+^^^^^
-.. autoclass:: pytiled_parser.Chunk
+.. autoclass:: pytiled_parser.layer.Chunk
:members:
-pytiled_parser.ObjectLayer
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+ObjectLayer
+^^^^^^^^^^^
-.. autoclass:: pytiled_parser.ObjectLayer
+.. autoclass:: pytiled_parser.layer.ObjectLayer
:members:
-pytiled_parser.ImageLayer
-^^^^^^^^^^^^^^^^^^^^^^^^^
+ImageLayer
+^^^^^^^^^^
-.. autoclass:: pytiled_parser.ImageLayer
+.. autoclass:: pytiled_parser.layer.ImageLayer
:members:
-pytiled_parser.LayerGroup
-^^^^^^^^^^^^^^^^^^^^^^^^^
+LayerGroup
+^^^^^^^^^^
-.. autoclass:: pytiled_parser.LayerGroup
+.. autoclass:: pytiled_parser.layer.LayerGroup
:members:
\ No newline at end of file
diff --git a/docs/api/map.rst b/docs/api/map.rst
new file mode 100644
index 0000000..638e9b6
--- /dev/null
+++ b/docs/api/map.rst
@@ -0,0 +1,10 @@
+.. _map_api:
+Map
+===
+
+This module provides the primary TiledMap class which represents a single map from Tiled.
+
+TiledMap
+^^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_map.TiledMap
\ No newline at end of file
diff --git a/docs/api/objects.rst b/docs/api/objects.rst
new file mode 100644
index 0000000..d883070
--- /dev/null
+++ b/docs/api/objects.rst
@@ -0,0 +1,59 @@
+.. _objects_api:
+Objects
+=======
+
+This module provides classes for all of the Tiled Object types.
+
+There is the base TiledObject class, which all of the actual object types inherit from.
+The base TiledObject class is never directly used, and serves only as an abstract base
+for common elements between all types.
+
+Some objects have no extra attributes over the base class, they exist as different classes anyways
+to denote the type of object, so that an implementation can load it in accordingly. For example, an
+Ellipse and a Point have no differing attributes from the base class, but obviously need to be handled
+very differently.
+
+For more information about objects, see `Tiled's Manual `_
+
+Also see the `TMX Reference `_
+and `JSON Reference `_
+
+TiledObject
+^^^^^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.TiledObject
+
+Ellipse
+^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Ellipse
+
+Point
+^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Point
+
+Polygon
+^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Polygon
+
+Polyline
+^^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Polyline
+
+Rectangle
+^^^^^^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Rectangle
+
+Text
+^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Text
+
+Tile
+^^^^
+
+.. autoclass:: pytiled_parser.tiled_object.Tile
\ No newline at end of file
diff --git a/docs/api/parser.rst b/docs/api/parser.rst
new file mode 100644
index 0000000..56942ad
--- /dev/null
+++ b/docs/api/parser.rst
@@ -0,0 +1,17 @@
+.. _parser_api:
+Parser
+======
+
+This module exposes the actual parsing functions. If you are creating an implementation, this is
+what you will actually pass a file to and receive back a PyTiled Parser Map or World class depending
+on what you're parsing.
+
+pytiled_parser.parse_map
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. autofunction:: pytiled_parser.parse_map
+
+pytiled_parser.parse_world
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. autofunction:: pytiled_parser.parse_world
\ No newline at end of file
diff --git a/docs/api/tileset.rst b/docs/api/tileset.rst
new file mode 100644
index 0000000..aede5ac
--- /dev/null
+++ b/docs/api/tileset.rst
@@ -0,0 +1,34 @@
+.. _tileset_api:
+Tileset
+=======
+
+This module provides an interface for Tilesets and the various objects they contain.
+
+Also see `Tiled's Docs for Editing Tilesets `_
+and the `TMX Reference `_
+and `JSON Reference `_
+
+Tileset
+^^^^^^^
+
+.. autoclass:: pytiled_parser.tileset.Tileset
+
+Tile
+^^^^
+
+.. autoclass:: pytiled_parser.tileset.Tile
+
+Transformations
+^^^^^^^^^^^^^^^
+
+.. autoclass:: pytiled_parser.tileset.Transformations
+
+Frame
+^^^^^
+
+.. autoclass:: pytiled_parser.tileset.Frame
+
+Grid
+^^^^
+
+.. autoclass:: pytiled_parser.tileset.Grid
\ No newline at end of file
diff --git a/docs/api/wang_set.rst b/docs/api/wang_set.rst
new file mode 100644
index 0000000..f0491bc
--- /dev/null
+++ b/docs/api/wang_set.rst
@@ -0,0 +1,28 @@
+.. _wang_set_api:
+Wang Set
+========
+
+This module contains a number of classes related to Wang Sets.
+
+Wang Sets are the underlying data used by Tiled's terrain system. It is unlikely this module will
+ever need touched for creating an implementation in a game engine. It is primarily data used by the
+editor during map creation.
+
+See `Tiled's docs about terrain `_
+and also the `TMX Reference `_
+and the `JSON Reference `_
+
+WangSet
+^^^^^^^
+
+.. autoclass:: pytiled_parser.wang_set.WangSet
+
+WangColor
+^^^^^^^^^
+
+.. autoclass:: pytiled_parser.wang_set.WangColor
+
+WangTile
+^^^^^^^^
+
+.. autoclass:: pytiled_parser.wang_set.WangTile
\ No newline at end of file
diff --git a/docs/api/world.rst b/docs/api/world.rst
new file mode 100644
index 0000000..4805353
--- /dev/null
+++ b/docs/api/world.rst
@@ -0,0 +1,23 @@
+.. _world_api:
+World
+=====
+
+This module provides an implementation for the World files from Tiled.
+
+See `Tiled's docs for Worlds `_
+for more info about worlds and what they do.
+
+The functionality within PyTiled Parser is to load the world and outline the size
+and position of each map, and provide the path to the map file. Loading a world
+does not automatically load each map within the world, this is so that the game
+or engine implementation can decide how to handle map loading.
+
+WorldMap
+^^^^^^^^
+
+.. autoclass:: pytiled_parser.world.WorldMap
+
+World
+^^^^^
+
+.. autoclass:: pytiled_parser.world.World
\ No newline at end of file
diff --git a/pytiled_parser/__init__.py b/pytiled_parser/__init__.py
index ef69e82..760b1bc 100644
--- a/pytiled_parser/__init__.py
+++ b/pytiled_parser/__init__.py
@@ -14,8 +14,9 @@ PyTiled Parser is not tied to any particular graphics library or game engine.
from .common_types import Color, OrderedPair, Size
from .exception import UnknownFormat
from .layer import Chunk, ImageLayer, Layer, LayerGroup, ObjectLayer, TileLayer
-from .parser import parse_map
+from .parser import parse_map, parse_world
from .properties import Properties, Property
from .tiled_map import TiledMap
-from .tileset import Tile, Tileset
+from .tileset import Frame, Grid, Tile, Tileset, Transformations
from .version import __version__
+from .world import World, WorldMap
diff --git a/pytiled_parser/common_types.py b/pytiled_parser/common_types.py
index 8b971a7..62b6a26 100644
--- a/pytiled_parser/common_types.py
+++ b/pytiled_parser/common_types.py
@@ -8,10 +8,11 @@ from typing import NamedTuple
class Color(NamedTuple):
"""Represents an RGBA color value as a four value Tuple.
- :param int red: Red value, between 0 and 255.
- :param int green: Green value, between 0 and 255.
- :param int blue: Blue value, between 0 and 255.
- :param int alpha: Alpha value, between 0 and 255.
+ Attributes:
+ red: Red value, between 0 and 255.
+ green: Green value, between 0 and 255.
+ blue: Blue value, between 0 and 255.
+ alpha: Alpha value, between 0 and 255.
"""
red: int
green: int
@@ -22,8 +23,9 @@ class Color(NamedTuple):
class Size(NamedTuple):
"""Represents a two dimensional size as a two value Tuple.
- :param int width: The width of the object. Can be in either pixels or number of tiles.
- :param int height: The height of the object. Can be in either pixels or number of tiles.
+ Attributes:
+ width: The width of the object. Can be in either pixels or number of tiles.
+ height: The height of the object. Can be in either pixels or number of tiles.
"""
width: float
@@ -33,8 +35,9 @@ class Size(NamedTuple):
class OrderedPair(NamedTuple):
"""Represents a two dimensional position as a two value Tuple.
- :param int x: X coordinate. Can be in either pixels or number of tiles.
- :param int y: Y coordinate. Can be in either pixels or number of tiles.
+ Attributes:
+ x: X coordinate. Can be in either pixels or number of tiles.
+ y: Y coordinate. Can be in either pixels or number of tiles.
"""
x: float
diff --git a/pytiled_parser/layer.py b/pytiled_parser/layer.py
index 946d2a5..fac833b 100644
--- a/pytiled_parser/layer.py
+++ b/pytiled_parser/layer.py
@@ -29,19 +29,20 @@ class Layer:
`JSON Reference `_
- :param str name: The name of the layer object.
- :param float opacity: Decimal value between 0 and 1 to determine opacity. 1 is completely
- opaque, 0 is completely transparent. Defaults to 1.
- :param bool visible: If the layer is visible in the Tiled Editor. Defaults to True
- :param OrderedPair coordinates: Where layer content starts in tiles. Only used by infinite maps.
- Defaults to (0, 0).
- :param OrderedPair parallax_factor: Used to determine parallaxing speed of a layer. Defaults to (1, 1).
- :param OrderedPair offset: Rendering offset of the layer object in pixels. Defaults to (0, 0).
- :param Optional[int] id: Unique ID of the layer. Each layer that is added to a map gets a unique id.
- Even if a layer is deleted, no layer ever gets the same ID.
- :param Optional[Size] size: Ordered pair of size of map in tiles.
- :param Optional[Properties] properties: Properties for the layer.
- :param Optional[Color] tint_color: Tint color that is multiplied with any graphics in this layer.
+ Attributes:
+ name: The name of the layer object.
+ opacity: Decimal value between 0 and 1 to determine opacity. 1 is completely
+ opaque, 0 is completely transparent. Defaults to 1.
+ visible: If the layer is visible in the Tiled Editor. Defaults to True
+ coordinates: Where layer content starts in tiles. Only used by infinite maps.
+ Defaults to (0, 0).
+ parallax_factor: Used to determine parallaxing speed of a layer. Defaults to (1, 1).
+ offset: Rendering offset of the layer object in pixels. Defaults to (0, 0).
+ id: Unique ID of the layer. Each layer that is added to a map gets a unique id.
+ Even if a layer is deleted, no layer ever gets the same ID.
+ size: Ordered pair of size of map in tiles.
+ properties: Properties for the layer.
+ tint_color: Tint color that is multiplied with any graphics in this layer.
"""
name: str
@@ -72,9 +73,10 @@ class Chunk:
`JSON Reference `_
- :param OrderedPair coordinates: Location of chunk in tiles.
- :param Size size: The size of the chunk in tiles.
- :param List[List[int]] data: The global tile IDs in the chunk. A row-first two dimensional array.
+ Attributes:
+ coordinates: Location of chunk in tiles.
+ size: The size of the chunk in tiles.
+ data: The global tile IDs in the chunk. A row-first two dimensional array.
"""
coordinates: OrderedPair
@@ -99,8 +101,9 @@ class TileLayer(Layer):
`JSON Reference `_
- :param Optional[List[Chunk]] chunks: List of chunks (only populated for infinite maps)
- :param Optional[List[List[int]] data: A two dimensional array of integers representing the global
+ Attributes:
+ chunks: List of chunks (only populated for infinite maps)
+ data: A two dimensional array of integers representing the global
tile IDs for the layer (only populaed for non-infinite maps)
"""
@@ -118,12 +121,13 @@ class ObjectLayer(Layer):
`JSON Reference `_
- :param List[TiledOjbect] tiled_objects: List of tiled_objects in the layer.
- :param Optional[str] draworder: Whether the objects are drawn according to the order of the object
- elements in the object group element ('manual'), or sorted by their
- y-coordinate ('topdown'). Defaults to 'topdown'. See:
- https://doc.mapeditor.org/en/stable/manual/objects/#changing-stacking-order
- for more info.
+ Attributes:
+ tiled_objects: List of tiled_objects in the layer.
+ draworder: Whether the objects are drawn according to the order of the object
+ elements in the object group element ('manual'), or sorted by their
+ y-coordinate ('topdown'). Defaults to 'topdown'. See:
+ https://doc.mapeditor.org/en/stable/manual/objects/#changing-stacking-order
+ for more info.
"""
tiled_objects: List[TiledObject]
@@ -141,8 +145,9 @@ class ImageLayer(Layer):
`JSON Reference `_
- :param Path image: The image used by this layer.
- :param Optional[Color] transparent_color: Color that is to be made transparent on this layer.
+ Attributes:
+ image: The image used by this layer.
+ transparent_color: Color that is to be made transparent on this layer.
"""
image: Path
@@ -163,7 +168,8 @@ class LayerGroup(Layer):
`JSON Reference `_
- :param Optional[List[Layer]] layers: list of layers contained in the group.
+ Attributes:
+ layers: list of layers contained in the group.
"""
layers: Optional[List[Layer]]
diff --git a/pytiled_parser/parser.py b/pytiled_parser/parser.py
index d3704d8..0113fe5 100644
--- a/pytiled_parser/parser.py
+++ b/pytiled_parser/parser.py
@@ -5,6 +5,8 @@ from pytiled_parser.parsers.json.tiled_map import parse as json_map_parse
from pytiled_parser.parsers.tmx.tiled_map import parse as tmx_map_parse
from pytiled_parser.tiled_map import TiledMap
from pytiled_parser.util import check_format
+from pytiled_parser.world import World
+from pytiled_parser.world import parse_world as _parse_world
def parse_map(file: Path) -> TiledMap:
@@ -14,7 +16,7 @@ def parse_map(file: Path) -> TiledMap:
file: Path to the map file
Returns:
- TiledMap: a properly typed TiledMap
+ TiledMap: A parsed and typed TiledMap
"""
parser = check_format(file)
@@ -29,3 +31,14 @@ def parse_map(file: Path) -> TiledMap:
"Unknown Map Format, please use either the TMX or JSON format. "
"This message could also mean your map file is invalid or corrupted."
)
+
+def parse_world(file: Path) -> World:
+ """Parse the raw world file into a pytiled_parser type
+
+ Args:
+ file: Path to the world file
+
+ Returns:
+ World: A parsed and typed World
+ """
+ return _parse_world(file)
diff --git a/pytiled_parser/tiled_map.py b/pytiled_parser/tiled_map.py
index 04d252f..edca2f1 100644
--- a/pytiled_parser/tiled_map.py
+++ b/pytiled_parser/tiled_map.py
@@ -23,9 +23,9 @@ class TiledMap:
as well as all Tiesets used by the map. When creating an implementation, this will
be the primary class to work with to pull all data relating to a map.
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#map)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#map)
+ `JSON Reference `_
Attributes:
infinite: If the map is infinite or not.
@@ -37,9 +37,9 @@ class TiledMap:
"staggered" and "hexagonal"
render_order: The order in which tiles on tile layers are rendered. Valid values
are right-down, right-up, left-down and left-up. In all cases, the map is
+ drawn row-by-row. (only supported for orthogonal maps at the moment)
tiled_version: The Tiled version used to save the file. May be a date (for
snapshot builds).
- drawn row-by-row. (only supported for orthogonal maps at the moment)
tile_size: The size of a tile.
tilesets: Dict of Tileset where Key is the firstgid and the value is the Tileset
version: The JSON format version.
diff --git a/pytiled_parser/tiled_object.py b/pytiled_parser/tiled_object.py
index a96d65a..811e1b9 100644
--- a/pytiled_parser/tiled_object.py
+++ b/pytiled_parser/tiled_object.py
@@ -65,7 +65,7 @@ class Polygon(TiledObject):
See: https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#polygon
Attributes:
- points: FIXME
+ points: List of coordinates relative to the location of the object.
"""
points: List[OrderedPair]
@@ -103,18 +103,19 @@ class Text(TiledObject):
and https://doc.mapeditor.org/en/stable/manual/objects/#insert-text
Attributes:
+ text: The text to display
+ color: Color of the text. (default: (255, 255, 255, 255))
font_family: The font family used (default: "sans-serif")
font_size: The size of the font in pixels. (default: 16)
- wrap: Whether word wrapping is enabled. (default: False)
- color: Color of the text. (default: #000000)
bold: Whether the font is bold. (default: False)
italic: Whether the font is italic. (default: False)
- underline: Whether the text is underlined. (default: False)
- strike_out: Whether the text is striked-out. (default: False)
kerning: Whether kerning should be used while rendering the text. (default:
False)
+ strike_out: Whether the text is striked-out. (default: False)
+ underline: Whether the text is underlined. (default: False)
horizontal_align: Horizontal alignment of the text (default: "left")
vertical_align: Vertical alignment of the text (defalt: "top")
+ wrap: Whether word wrapping is enabled. (default: False)
"""
text: str
diff --git a/pytiled_parser/tileset.py b/pytiled_parser/tileset.py
index 91e4221..a1c2a97 100644
--- a/pytiled_parser/tileset.py
+++ b/pytiled_parser/tileset.py
@@ -22,9 +22,9 @@ class Grid(NamedTuple):
This element is only used in case of isometric orientation, and determines how tile
overlays for terrain and collision information are rendered.
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tmx-grid)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#grid)
+ `JSON Reference `_
Attributes:
orientation: Orientation of the grid for the tiles in this tileset (orthogonal
@@ -45,9 +45,9 @@ class Frame(NamedTuple):
to a tile within the tileset, and gives a duration. Meaning that tile would be
displayed for the given duration.
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tmx-frame)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#json-frame)
+ `JSON Reference `_
Attributes:
tile_id: The local ID of a tile within the parent tile set object.
@@ -68,9 +68,9 @@ class Transformations:
the terrain system, however, could be used for any means a game/engine
wants to really.
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#transformations)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#transformations)
+ `JSON Reference `_
Attributes:
hflip: Allow horizontal flip?
@@ -92,9 +92,9 @@ class Tile:
This class more closely resembles the JSON format than TMX. A number of values
within this class in the TMX format are pulled into other sub-tags such as .
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tile)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#tile-definition)
+ `JSON Reference `_
Attributes:
id: The local tile ID within it's tileset.
@@ -135,11 +135,11 @@ class Tile:
class Tileset:
"""A Tileset is a collection of tiles.
- As with the Tile class, this one more closely resembles the JSON format than TMX.
+ This class much more closely resembles the JSON format than TMX.
- [TMX Reference](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tileset)
+ `TMX Reference `_
- [JSON Reference](https://doc.mapeditor.org/en/stable/reference/json-map-format/#tileset)
+ `JSON Reference `_
Attributes:
name: The name of this tileset.
@@ -148,30 +148,38 @@ class Tileset:
tile_count: The number of tiles in this tileset.
columns: The number of tile columns in the tileset. For image collection
tilesets it is editable and is used when displaying the tileset.
- spacing: The spacing in pixels between the tiles in this tileset (applies to
- the tileset image).
firstgid: The global ID to give to the first Tile in this tileset. Global IDs
for the rest of the tiles will increment from this number.
+ spacing: The spacing in pixels between the tiles in this tileset (applies to
+ the tileset image).
type: Will always be `tileset`. Is statically included as a way to determine the
type of a JSON file since Tiled does not have different extesnsions for map
- and tileset JSON files(as opposed to TMX/TSX files)
- spacing: Spacing between adjacent tiles in the image in pixels.
- margin: Buffer between the image edge and the first tile in the image in pixels.
- image: Used for spritesheet tile sets.
- image_width: The width of the `image` in pixels.
- image_height: The height of the `image` in pixels.
- transformations: What types of transformations are allowed on tiles within this
- Tileset
- background_color: The background color of the tileset.
+ and tileset JSON files(as opposed to TMX/TSX files). This value will typically not be used.
+ spacing: Spacing between adjacent tiles in the image in pixels. Defaults to 0.
+ margin: Buffer between the image edge and the first tile in the image in pixels. Defaults to 0.
+ tiled_version: The version of Tiled this tileset was saved with
+ version: The version of the JSON or TSX format this tileset was saved with.
+ This will typically be the same as the tiled_version parameter, but they are tracked separately
+ mostly for futureproofing.
+ image: The image file to be used for spritesheet tile sets.
+ image_width: The width of the `image` in pixels. Only set if the image parameter is.
+ This value is taken from whatever Tiled outputs, the image size is not calculated by pytiled-parser.
+ image_height: The height of the `image` in pixels. Only set if the image parameter is.
+ This value is taken from whatever Tiled outputs, the image size is not calculated by pytiled-parser.
+ transformations: What types of transformations are allowed on tiles within
+ this Tileset
+ background_color: The background color of the tileset. This will typically only be
+ used by the editor, but could be useful for displaying a TileSet if you had the need to do that.
tileoffset: Used to specify an offset in pixels when drawing a tile from the
tileset. When not present, no offset is applied.
- transparent_color: A color that acts as transparent on any tiles within the
- tileset.
+ transparent_color: A color that should act as transparent on any tiles within the
+ tileset. This would need to be taken into account by an implementation when loading the tile images.
grid: Only used in case of isometric orientation, and determines how tile
overlays for terrain and collision information are rendered.
properties: The properties for this Tileset.
- tiles: Dict of Tile objects by Tile.id.
- wang_sets: List of WangSets used by the terrain system
+ tiles: Dict of Tile objects with the Tile.id value as the key.
+ wang_sets: List of WangSets, this is used by the terrain system in Tiled. It is unlikely an
+ implementation in a game engine would need to use these values.
alignment: Which alignment to use for tile objects from this tileset.
"""
diff --git a/pytiled_parser/world.py b/pytiled_parser/world.py
index 837da09..67214a6 100644
--- a/pytiled_parser/world.py
+++ b/pytiled_parser/world.py
@@ -33,7 +33,7 @@ class WorldMap:
Attributes:
map_file: A Path object to the map file, can be passed to
- [parse_map][pytiled_parser.parser.parse_map]
+ the pytiled_parser.parse_map function later.
size: The size of the map in pixels
coordinates: The position of the map within the world in pixels
"""
@@ -49,8 +49,7 @@ class World:
Attributes:
maps: The list of maps within the world. These are not fully parsed
- [TiledMap][pytiled_parser.tiled_map.TiledMap] objects, but rather
- [WorldMap][pytiled_parser.world.WorldMap] objects which can be used
+ TiledMap objects, but rather WorldMap objects which can be used
to later parse each individual map.
only_show_adjacent: Largely only used by the Tiled editor to determine
if only maps adjacent to the active one should be displayed. This