libtmx  0.4.0
an C++11 library for reading TMX files
Public Member Functions | List of all members
tmx::ImageLayer Class Reference

An image layer is a layer with a single image. More...

#include <tmx/ImageLayer.h>

Inheritance diagram for tmx::ImageLayer:
Inheritance graph
[legend]

Public Member Functions

 ImageLayer (const std::string &name, double opacity, bool visible)
 ImageLayer constructor. More...
 
virtual void accept (const Map &map, LayerVisitor &visitor) const override
 Accept function in the visitor pattern. More...
 
void setImage (std::unique_ptr< Image > image)
 Assign the image for the layer. More...
 
const ImagegetImage () const noexcept
 Get the image assigned to the layer. More...
 
- Public Member Functions inherited from tmx::Layer
 Layer (const std::string &name, double opacity, bool visible)
 Layer constructor. More...
 
virtual ~Layer ()
 Layer destructor. More...
 
const std::string & getName () const noexcept
 Get the name of the layer. More...
 
double getOpacity () const noexcept
 Get the opacity of the layer. More...
 
bool isVisible () const noexcept
 Tell whether the layer is visible. More...
 
- Public Member Functions inherited from tmx::Component
bool hasProperty (const std::string &key) const noexcept
 Tell if the object has a given property. More...
 
const std::string & getProperty (const std::string &key, const std::string &def) const noexcept
 Get a property value. More...
 
bool addProperty (const std::string &key, const std::string &value)
 Add a property. More...
 

Detailed Description

An image layer is a layer with a single image.

Constructor & Destructor Documentation

tmx::ImageLayer::ImageLayer ( const std::string &  name,
double  opacity,
bool  visible 
)
inline

ImageLayer constructor.

Member Function Documentation

virtual void tmx::ImageLayer::accept ( const Map map,
LayerVisitor visitor 
) const
overridevirtual

Accept function in the visitor pattern.

Parameters
visitorthe visitor

Implements tmx::Layer.

const Image* tmx::ImageLayer::getImage ( ) const
inlinenoexcept

Get the image assigned to the layer.

Returns
the image
void tmx::ImageLayer::setImage ( std::unique_ptr< Image image)
inline

Assign the image for the layer.

Parameters
imagethe image