Common Types#

This module provides some common types used throughout PyTiled Parser. These are all just NamedTuple classes provided to make sets of data more clear. As such they can be subscripted like a normal tuple to get the same values, or you can reference them by name. The values shown here are in the order they will be in the final tuple.

Color#

class pytiled_parser.common_types.Color(red: int, green: int, blue: int, alpha: int)#

Represents an RGBA color value as a four value Tuple.

red#

Red value, between 0 and 255.

Type:

int

green#

Green value, between 0 and 255.

Type:

int

blue#

Blue value, between 0 and 255.

Type:

int

alpha#

Alpha value, between 0 and 255.

Type:

int

OrderedPair#

class pytiled_parser.common_types.OrderedPair(x: float, y: float)#

Represents a two dimensional position as a two value Tuple.

x#

X coordinate. Can be in either pixels or number of tiles.

Type:

float

y#

Y coordinate. Can be in either pixels or number of tiles.

Type:

float

Size#

class pytiled_parser.common_types.Size(width: float, height: float)#

Represents a two dimensional size as a two value Tuple.

width#

The width of the object. Can be in either pixels or number of tiles.

Type:

float

height#

The height of the object. Can be in either pixels or number of tiles.

Type:

float