30#include <tmxlite/Config.hpp>
31#include <tmxlite/Layer.hpp>
32#include <tmxlite/Types.hpp>
41 class TMXLITE_EXPORT_API ImageLayer final :
public Layer
44 explicit ImageLayer(
const std::string&);
47 void parse(
const pugi::xml_node&,
Map*)
override;
87 bool locked()
const {
return m_locked;}
90 std::string m_workingDir;
91 std::string m_filePath;
92 Colour m_transparencyColour;
93 bool m_hasTransparency;
103 assert(
getType() == Type::Image);
104 return *
static_cast<ImageLayer*
>(
this);
110 assert(
getType() == Type::Image);
111 return *
static_cast<const ImageLayer*
>(
this);
Image layers contain a single image which make up that layer. The parser contains the fully resolved ...
Definition ImageLayer.hpp:42
bool hasRepeatY() const
Returns true if the image drawn by this layer is repeated along the Y axis.
Definition ImageLayer.hpp:82
Type getType() const override
Returns a Type value representing the concrete type. Use this when deciding which concrete layer type...
Definition ImageLayer.hpp:46
const Colour & getTransparencyColour() const
Returns the colour used by the image to represent transparent pixels. By default this is (0,...
Definition ImageLayer.hpp:59
const std::string & getImagePath() const
Returns the path, relative to the working directory, of the image used by the image layer.
Definition ImageLayer.hpp:53
const Vector2u & getImageSize() const
Returns the size of the image of the image layer in pixels.
Definition ImageLayer.hpp:70
bool hasRepeatX() const
Returns true if the image drawn by this layer is repeated along the X axis.
Definition ImageLayer.hpp:76
bool hasTransparency() const
Returns true if the image used by this layer specifically states a colour to use as transparency.
Definition ImageLayer.hpp:65
bool locked() const
Returns true if the image drawn by this layer is locked.
Definition ImageLayer.hpp:87
void parse(const pugi::xml_node &, Map *) override
Attempts to parse the specific node layer type.
T & getLayerAs()
Use this to get a reference to the concrete layer type which this layer points to....
Type
Layer type as returned by getType() Tile: this layer is a TileLayer type Object: This layer is an Obj...
Definition Layer.hpp:71
virtual Type getType() const =0
Returns a Type value representing the concrete type. Use this when deciding which concrete layer type...
Parser for TMX format tile maps. This class can be used to parse the XML format tile maps created wit...
Definition Map.hpp:94
Contains the red, green, blue and alpha values of a colour in the range 0 - 255.
Definition Types.hpp:111