tmxlite 1.0.0
lightweight parse for Tiled maps
|
A layer made up from a series of tile sets. More...
#include <TileLayer.hpp>
Classes | |
struct | Chunk |
Represents a chunk of tile data, if this is an infinite map. More... | |
struct | Tile |
Tile information for a layer. More... | |
Public Types | |
enum | FlipFlag { Horizontal = 0x8 , Vertical = 0x4 , Diagonal = 0x2 } |
Flags used to tell if a tile is flipped when drawn. | |
![]() | |
enum class | Type { Tile , Object , Image , Group } |
Layer type as returned by getType() Tile: this layer is a TileLayer type Object: This layer is an ObjectGroup type Image: This layer is an ImageLayer type Group: This layer is a LayerGroup type. | |
using | Ptr = std::unique_ptr<Layer> |
Public Member Functions | |
TileLayer (std::size_t) | |
Type | getType () const override |
Returns a Type value representing the concrete type. Use this when deciding which conrete layer type to use when calling the templated function getLayerAs<T>() | |
void | parse (const pugi::xml_node &, Map *) override |
Attempts to parse the specific node layer type. | |
const std::vector< Tile > & | getTiles () const |
Returns the list of tiles used to make up the layer If this is empty then the map is most likely infinite, in which case the tile data is stored in chunks. | |
const std::vector< Chunk > & | getChunks () const |
Returns a vector of chunks which make up this layer if the map is set to infinite. This will be empty if the map is not infinite. | |
![]() | |
const std::string & | getClass () const |
Returns the class of the Layer, as defined in the editor Tiled 1.9+. | |
template<typename T > | |
T & | getLayerAs () |
Use this to get a reference to the concrete layer type which this layer points to. Use getType() to return the type value of this layer and determine if the concrete type is TileLayer, ObjectGroup, ImageLayer, or LayerGroup. | |
template<typename T > | |
const T & | getLayerAs () const |
const std::string & | getName () const |
Returns the name of the layer. | |
float | getOpacity () const |
Returns the opacity value for the layer. | |
bool | getVisible () const |
Returns whether this layer is visible or not. | |
const Vector2i & | getOffset () const |
Returns the offset from the top left corner of the layer, in pixels. | |
const Vector2f & | getParallaxFactor () const |
Returns the parallax factor. | |
Colour | getTintColour () const |
Returns the tint colour of the layer. Defaults to 0xFFFFFFFF - pure white. | |
const Vector2u & | getSize () const |
Returns the size of the layer, in pixels. This will be the same as the map size for fixed size maps. | |
const std::vector< Property > & | getProperties () const |
Returns the list of properties of this layer. | |
template<> | |
ImageLayer & | getLayerAs () |
template<> | |
const ImageLayer & | getLayerAs () const |
template<> | |
LayerGroup & | getLayerAs () |
template<> | |
const LayerGroup & | getLayerAs () const |
template<> | |
ObjectGroup & | getLayerAs () |
template<> | |
const ObjectGroup & | getLayerAs () const |
template<> | |
TileLayer & | getLayerAs () |
template<> | |
const TileLayer & | getLayerAs () const |
Additional Inherited Members | |
![]() | |
void | setName (const std::string &name) |
void | setClass (const std::string &cls) |
void | setOpacity (float opacity) |
void | setVisible (bool visible) |
void | setOffset (std::int32_t x, std::int32_t y) |
void | setParallaxFactor (float x, float y) |
void | setTintColour (Colour c) |
void | setSize (std::uint32_t width, std::uint32_t height) |
void | addProperty (const pugi::xml_node &node) |
A layer made up from a series of tile sets.
Returns a vector of chunks which make up this layer if the map is set to infinite. This will be empty if the map is not infinite.
Returns the list of tiles used to make up the layer If this is empty then the map is most likely infinite, in which case the tile data is stored in chunks.
|
inlineoverridevirtual |
Returns a Type value representing the concrete type. Use this when deciding which conrete layer type to use when calling the templated function getLayerAs<T>()
Implements tmx::Layer.
Attempts to parse the specific node layer type.
Implements tmx::Layer.