30#include <tmxlite/Config.hpp>
31#include <tmxlite/Property.hpp>
32#include <tmxlite/Types.hpp>
49 struct TMXLITE_EXPORT_API
Text final
51 std::string fontFamily;
52 std::uint32_t pixelSize = 16;
57 bool underline =
false;
58 bool strikethough =
false;
64 }hAlign = HAlign::Left;
69 }vAlign = VAlign::Top;
83 class TMXLITE_EXPORT_API
Object final
107 std::uint32_t
getUID()
const {
return m_UID; }
112 const std::string&
getName()
const {
return m_name; }
117 const std::string&
getType()
const {
return m_class; }
122 const std::string&
getClass()
const {
return m_class; }
172 const std::vector<Vector2f>&
getPoints()
const {
return m_points; }
188 Text& getText() {
return m_textData; }
205 std::uint32_t m_tileID;
206 std::uint8_t m_flipFlags;
210 std::vector<Vector2f> m_points;
211 std::vector<Property> m_properties;
215 std::string m_tilesetName;
217 void parsePoints(
const pugi::xml_node&);
218 void parseText(
const pugi::xml_node&);
219 void parseTemplate(
const std::string&,
Map*);
Parser for TMX format tile maps. This class can be used to parse the XML format tile maps created wit...
Definition Map.hpp:94
Objects are stored in ObjectGroup layers. Objects may be rectangular, elliptical, polygonal or a poly...
Definition Object.hpp:84
void parse(const pugi::xml_node &, Map *)
Attempts to parse the given xml node and read the Object properties if it is valid.
const FloatRect & getAABB() const
Returns the global Axis Aligned Bounding Box. The AABB is positioned via the left and top properties,...
Definition Object.hpp:135
float getRotation() const
Returns the rotation of the Object in degrees clockwise.
Definition Object.hpp:140
bool visible() const
Returns whether or not the Object is visible.
Definition Object.hpp:159
std::uint32_t getUID() const
Returns the unique ID of the Object.
Definition Object.hpp:107
const std::string & getClass() const
Returns the class (equal to type) of the Object, as defined in the editor Tiled 1....
Definition Object.hpp:122
const Vector2f & getPosition() const
Returns the position of the Object in pixels.
Definition Object.hpp:127
const std::vector< Property > & getProperties() const
Returns a reference to the vector of properties belonging to the Object.
Definition Object.hpp:178
const std::string & getTilesetName() const
Returns the tileset name used by this object if it is derived from a template, else returns an empty ...
Definition Object.hpp:196
std::uint8_t getFlipFlags() const
Returns the flip flags if the objects uses a TileID to draw it. Returns 0 otherwise.
Definition Object.hpp:154
const std::vector< Vector2f > & getPoints() const
Returns a reference to the vector of points which make up the Object. If the Object is rectangular or...
Definition Object.hpp:172
const std::string & getName() const
Returns the name of the Object.
Definition Object.hpp:112
const Text & getText() const
Returns a Text struct containing information about any text this object may have, such as font data a...
Definition Object.hpp:187
std::uint32_t getTileID() const
Returns the global tile ID associated with the Object if there is one. This is used to draw the Objec...
Definition Object.hpp:147
Shape getShape() const
Returns the Shape type of the Object.
Definition Object.hpp:164
const std::string & getType() const
Returns the type (equal to class) of the Object, as defined in the editor Tiled < 1....
Definition Object.hpp:117
Contains the red, green, blue and alpha values of a colour in the range 0 - 255.
Definition Types.hpp:111
Describes a rectangular area, such as an AABB (axis aligned bounding box)
Definition Types.hpp:96
Contains the text information stored in a Text object.
Definition Object.hpp:50
std::string content
actual string content
Definition Object.hpp:71