tmxlite
lightweight Tiled tmx map parser for C++
Public Types | Public Member Functions | Protected Member Functions | List of all members
tmx::Layer Class Referenceabstract

Represents a layer of a tmx format tile map. This is an abstract base class from which all layer types are derived. More...

#include <Layer.hpp>

Inheritance diagram for tmx::Layer:
tmx::ImageLayer tmx::ObjectGroup tmx::TileLayer

Public Types

enum  Type { Tile, Object, Image }
 
using Ptr = std::unique_ptr< Layer >
 

Public Member Functions

virtual Type getType () const =0
 Returns a Type value representing the concrete type.
 
virtual void parse (const pugi::xml_node &)=0
 Attempts to parse the specific node layer type.
 
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 Vector2igetOffset () const
 Returns the offset from the top left corner of the layer, in pixels.
 
const std::vector< Property > & getProperties () const
 Returns the list of properties of this layer.
 

Protected Member Functions

void setName (const std::string &name)
 
void setOpacity (float opacity)
 
void setVisible (bool visible)
 
void setOffset (std::int32_t x, std::int32_t y)
 
void addProperty (const pugi::xml_node &node)
 

Detailed Description

Represents a layer of a tmx format tile map. This is an abstract base class from which all layer types are derived.


The documentation for this class was generated from the following file: