API Reference docs update

This commit is contained in:
Darren Eberly
2022-07-07 01:54:44 -04:00
parent 25067b276f
commit ddf314e4f0
17 changed files with 310 additions and 102 deletions

View File

@@ -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
.. autoclass:: pytiled_parser.common_types.Size

View File

@@ -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

View File

@@ -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 <https://doc.mapeditor.org/en/stable/manual/layers/>`_
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:

10
docs/api/map.rst Normal file
View File

@@ -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

59
docs/api/objects.rst Normal file
View File

@@ -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 <https://doc.mapeditor.org/en/stable/manual/objects/>`_
Also see the `TMX Reference <https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#object>`_
and `JSON Reference <https://doc.mapeditor.org/en/stable/reference/json-map-format/#object>`_
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

17
docs/api/parser.rst Normal file
View File

@@ -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

34
docs/api/tileset.rst Normal file
View File

@@ -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 <https://doc.mapeditor.org/en/stable/manual/editing-tilesets/>`_
and the `TMX Reference <https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tileset>`_
and `JSON Reference <https://doc.mapeditor.org/en/stable/reference/json-map-format/#tileset>`_
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

28
docs/api/wang_set.rst Normal file
View File

@@ -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 <https://doc.mapeditor.org/en/stable/manual/terrain/>`_
and also the `TMX Reference <https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#wangsets>`_
and the `JSON Reference <https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-set>`_
WangSet
^^^^^^^
.. autoclass:: pytiled_parser.wang_set.WangSet
WangColor
^^^^^^^^^
.. autoclass:: pytiled_parser.wang_set.WangColor
WangTile
^^^^^^^^
.. autoclass:: pytiled_parser.wang_set.WangTile

23
docs/api/world.rst Normal file
View File

@@ -0,0 +1,23 @@
.. _world_api:
World
=====
This module provides an implementation for the World files from Tiled.
See `Tiled's docs for Worlds <https://doc.mapeditor.org/en/stable/manual/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