28 #ifndef TMXLITE_OBJECT_HPP_ 29 #define TMXLITE_OBJECT_HPP_ 31 #include <tmxlite/Config.hpp> 32 #include <tmxlite/Property.hpp> 33 #include <tmxlite/Types.hpp> 48 struct TMXLITE_EXPORT_API
Text final
50 std::string fontFamily;
51 std::uint32_t pixelSize = 16;
56 bool underline =
false;
57 bool strikethough =
false;
63 }hAlign = HAlign::Left;
68 }vAlign = VAlign::Top;
82 class TMXLITE_EXPORT_API
Object final
101 void parse(
const pugi::xml_node&);
106 std::uint32_t
getUID()
const {
return m_UID; }
111 const std::string&
getName()
const {
return m_name; }
116 const std::string&
getType()
const {
return m_type; }
159 const std::vector<Vector2f>&
getPoints()
const {
return m_points; }
174 const Text&
getText()
const {
return m_textData; }
175 Text& getText() {
return m_textData; }
184 std::uint32_t m_tileID;
188 std::vector<Vector2f> m_points;
189 std::vector<Property> m_properties;
193 void parsePoints(
const pugi::xml_node&);
194 void parseText(
const pugi::xml_node&);
195 void parseTemplate(
const std::string&);
199 #endif //TMXLITE_OBJECT_HPP_
Contains the red, green, blue and alpha values of a colour in the range 0 - 255.
Definition: Types.hpp:109
std::uint32_t getUID() const
Returns the unique ID of the Object.
Definition: Object.hpp:106
Shape getShape() const
Returns the Shape type of the Object.
Definition: Object.hpp:151
const std::string & getType() const
Returns the type of the Object, as defined in the editor.
Definition: Object.hpp:116
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:141
float getRotation() const
Returns the rotation of the Object in degrees clockwise.
Definition: Object.hpp:134
std::string content
actual string content
Definition: Object.hpp:70
const std::string & getName() const
Returns the name of the Object.
Definition: Object.hpp:111
Objects are stored in ObjectGroup layers. Objects may be rectangular, elliptical, polygonal or a poly...
Definition: Object.hpp:82
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:159
const std::vector< Property > & getProperties() const
Returns a reference to the vector of properties belonging to the Object.
Definition: Object.hpp:165
bool visible() const
Returns whether or not the Object is visible.
Definition: Object.hpp:146
Describes a rectangular area, such as an AABB (axis aligned bounding box)
Definition: Types.hpp:94
const Vector2f & getPosition() const
Returns the position of the Object in pixels.
Definition: Object.hpp:121
const FloatRect & getAABB() const
Returns the global Axis Aligned Bounding Box. The AABB is positioned via the left and top properties...
Definition: Object.hpp:129
Contains the text information stored in a Text object.
Definition: Object.hpp:48
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:174