40 #ifndef DOXYGEN_SHOULD_SKIP_THIS 161 std::string
getStringProperty(
const std::string& name,
const std::string& def)
const;
197 Color4u
getColorProperty(
const std::string& name,
const Color4u& def)
const;
209 std::map<std::string, std::string> m_stringProps;
210 std::map<std::string,
int> m_intProps;
211 std::map<std::string,
double> m_floatProps;
212 std::map<std::string,
bool> m_boolProps;
213 std::map<std::string, Color4u> m_colorProps;
214 std::map<std::string, Path> m_fileProps;
604 RectU
getSubTexture(
unsigned id, Vector2u size)
const noexcept;
660 #ifndef DOXYGEN_SHOULD_SKIP_THIS Vector2u size
The size of the image.
Definition: Tmx.h:494
unsigned tileCount
The number of tiles.
Definition: Tmx.h:579
double opacity
The opacity of the layer.
Definition: Tmx.h:298
VAlign valign
The vertical alignment of the text.
Definition: Tmx.h:471
RectU getSubTexture(unsigned id, Vector2u size) const noexcept
Get the rectangle of a tile corresponding to an id.
Vector2u size
The size of the ellipse.
Definition: Tmx.h:402
A layer with an image.
Definition: Tmx.h:501
Flags< TmxFlip > flip
The flip properties of the tile.
Definition: Tmx.h:321
bool bold
Is the text in bold?
Definition: Tmx.h:445
TmxStaggerIndex
Stagger index of the hexagonal map.
Definition: Tmx.h:59
unsigned columnCount
The number of columns.
Definition: Tmx.h:580
A visitor for layers in the visitor pattern.
Definition: Tmx.h:231
TmxProperties properties
The properties of the terrain.
Definition: Tmx.h:544
void addIntProperty(std::string name, int value)
Add an integer property.
TmxFlip
A flag to indicate how to flip a tile in a cell.
Definition: Tmx.h:309
void addFileProperty(std::string name, Path value)
Add a file property.
bool wrap
The wrap mode.
Definition: Tmx.h:443
std::string text
The text of the object.
Definition: Tmx.h:439
std::vector< TmxTerrain > terrains
The terrains of the tileset.
Definition: Tmx.h:585
A rectangle object.
Definition: Tmx.h:393
std::string name
The name of the object.
Definition: Tmx.h:382
std::vector< TmxFrame > frames
The frames of the animation.
Definition: Tmx.h:534
unsigned gid
The global id of the tile.
Definition: Tmx.h:320
A bottom vertical alignment.
unsigned sizeInPixels
The size of the text in pixel.
Definition: Tmx.h:442
Color4u backgroundColor
The background color.
Definition: Tmx.h:627
std::vector< std::unique_ptr< TmxObject > > objects
The objects of the layer.
Definition: Tmx.h:481
virtual ~TmxObject()
Destructor.
const TmxTile * getTile(unsigned id) const noexcept
Get the tile corresponding to an id.
Bitfield relying on an enumeration.
Definition: Flags.h:68
TmxDrawOrder
The draw order of the objects.
Definition: Tmx.h:338
A left horizontal alignment.
Vector2u size
The size of the rectangle.
Definition: Tmx.h:394
Id id
The id of the object.
Definition: Tmx.h:381
virtual void visitTileLayer(const TmxLayers &map, const TmxTileLayer &layer)
Visit a tile layer.
TmxStaggerAxis staggerAxis
The stagger axis for hexagonal map.
Definition: Tmx.h:624
std::unique_ptr< TmxImage > image
The image of the layer.
Definition: Tmx.h:502
An ellipse object.
Definition: Tmx.h:401
virtual ~TmxLayer()
Destructor.
TmxDrawOrder drawOrder
The draw order of the objects.
Definition: Tmx.h:480
double rotation
The rotation of the object.
Definition: Tmx.h:385
unsigned spacing
The spacing between tiles (in pixels)
Definition: Tmx.h:577
unsigned tile
The representing tile for the terrain.
Definition: Tmx.h:546
A layer with objects.
Definition: Tmx.h:478
Path getFileProperty(const std::string &name, const Path &def) const
Get a file property.
An ellipse object.
Definition: Tmx.h:370
A layer in the whole map.
Definition: Tmx.h:280
Path source
The path to the image.
Definition: Tmx.h:492
std::string tiledVersion
The tiled version of the map.
Definition: Tmx.h:616
void visitLayers(TmxVisitor &visitor) const
Visit the layers with a visitor.
bool getBoolProperty(const std::string &name, bool def) const
Get a boolean property.
std::string name
The name of the tileset.
Definition: Tmx.h:575
A tile animation.
Definition: Tmx.h:533
A TMX map.
Definition: Tmx.h:612
bool kerning
Is the text using kerning?
Definition: Tmx.h:449
A tile object.
Definition: Tmx.h:373
std::string getStringProperty(const std::string &name, const std::string &def) const
Get a string property.
std::vector< TmxTileset > tilesets
The tilesets used in the map.
Definition: Tmx.h:631
void addFloatProperty(std::string name, double value)
Add a float property.
Represents a time value.
Definition: Time.h:73
std::unique_ptr< TmxAnimation > animation
The animation data of the tile.
Definition: Tmx.h:564
std::vector< TmxTile > tiles
The tiles of the tileset.
Definition: Tmx.h:586
TmxProperties(TmxProperties &&)=default
Default move constructor.
Vector2u position
The position of the object.
Definition: Tmx.h:384
std::string fontFamily
The font family.
Definition: Tmx.h:441
Color4u transparent
The transparent color.
Definition: Tmx.h:493
Vector2i offset
The offset of the layer.
Definition: Tmx.h:300
void addColorProperty(std::string name, Color4u value)
Add a color property.
A text object.
Definition: Tmx.h:438
HAlign halign
The horizontal alignment of the text.
Definition: Tmx.h:460
A centered horizontal alignment.
virtual ~TmxVisitor()
Destructor.
std::string type
The type of the object.
Definition: Tmx.h:383
virtual void visitImageLayer(const TmxLayers &map, const TmxImageLayer &layer)
Visit an image layer.
TmxStaggerAxis
Stagger axis of the hexagonal map.
Definition: Tmx.h:68
std::vector< std::unique_ptr< TmxLayer > > layers
The layers of the map.
Definition: Tmx.h:632
std::string name
The name of the terrain.
Definition: Tmx.h:545
std::string version
The version of the map.
Definition: Tmx.h:615
virtual void accept(const TmxLayers &map, TmxVisitor &visitor) const =0
Accept function in the visitor pattern.
virtual void accept(const TmxLayers &map, TmxVisitor &visitor) const override
Accept function in the visitor pattern.
unsigned id
The local id of the tile.
Definition: Tmx.h:557
std::vector< std::unique_ptr< TmxLayer > > layers
The other layers.
Definition: Tmx.h:513
TmxRenderOrder renderOrder
The render order of the map.
Definition: Tmx.h:618
Kind
The kind of object.
Definition: Tmx.h:368
virtual void accept(const TmxLayers &map, TmxVisitor &visitor) const override
Accept function in the visitor pattern.
Vector2u mapSize
The size of the map.
Definition: Tmx.h:620
The namespace for gf classes.
Definition: Action.h:34
A polyline object.
Definition: Tmx.h:420
A centered vertical alignment.
unsigned hexSideLength
The length of the side for hexagonal map.
Definition: Tmx.h:623
TmxProperties properties
The properties of the tile.
Definition: Tmx.h:556
unsigned probability
The probability of the tile.
Definition: Tmx.h:560
TmxProperties & operator=(TmxProperties &&)=default
Default move assignment.
std::unique_ptr< TmxObjectLayer > objects
The objects in the tile.
Definition: Tmx.h:563
A frame in a tile animation.
Definition: Tmx.h:524
int getIntProperty(const std::string &name, int def) const
Get an integer property.
Vector2i offset
The offset of the tileset.
Definition: Tmx.h:582
TmxProperties properties
The properties of the tileset.
Definition: Tmx.h:572
TmxProperties properties
The properties of the map.
Definition: Tmx.h:613
Kind kind
The kind of the object.
Definition: Tmx.h:377
std::string type
The type of the tile.
Definition: Tmx.h:558
std::vector< Vector2i > points
The points of the polygon.
Definition: Tmx.h:431
Vector2u tileSize
The size of the tileset.
Definition: Tmx.h:576
TmxOrientation orientation
The orientation of the map.
Definition: Tmx.h:617
Color4u color
The color of the text.
Definition: Tmx.h:444
double getFloatProperty(const std::string &name, double def) const
Get a float property.
A description of a kind of terrain on the map.
Definition: Tmx.h:543
A rectangle object.
Definition: Tmx.h:369
The properties for TMX entities.
Definition: Tmx.h:89
bool visible
The visibility of the object.
Definition: Tmx.h:386
Flags< TmxFlip > flip
Definition: Tmx.h:411
VAlign
A vertical alignment.
Definition: Tmx.h:465
void addStringProperty(std::string name, std::string value)
Add a string property.
An isometric orientation.
A right horizontal alignment.
A rectangular part of a tileset.
Definition: Tmx.h:555
TmxRenderOrder
the render order of the tiles.
Definition: Tmx.h:77
std::string format
The format of the image.
Definition: Tmx.h:491
HAlign
An horizontal alignment.
Definition: Tmx.h:454
TmxStaggerIndex staggerIndex
The stagger index for hexagonal map.
Definition: Tmx.h:625
Color4u color
The color of the objects.
Definition: Tmx.h:479
A polygon object.
Definition: Tmx.h:372
A geometrical object.
Definition: Tmx.h:359
const TmxTileset * getTileSetFromGID(unsigned gid) const noexcept
Get the tileset corresponding to a global id.
A cell in a tile layer.
Definition: Tmx.h:319
std::unique_ptr< TmxImage > image
The image of this tile.
Definition: Tmx.h:562
A text object.
Definition: Tmx.h:374
unsigned margin
The margin around tiles (in pixels)
Definition: Tmx.h:578
virtual void accept(const TmxLayers &map, TmxVisitor &visitor) const override
Accept function in the visitor pattern.
unsigned tileId
Definition: Tmx.h:525
TmxOrientation
The orientation of the map.
Definition: Tmx.h:47
TmxProperties properties
The properties of the object.
Definition: Tmx.h:379
A set of tiles in a single file (image or TSX file)
Definition: Tmx.h:571
TmxProperties()=default
Default constructor.
unsigned nextObjectId
The next object id.
Definition: Tmx.h:629
unsigned firstGid
The first global id of the tileset.
Definition: Tmx.h:574
unsigned gid
Definition: Tmx.h:410
An image put in the map identified by its global id.
Definition: Tmx.h:409
virtual void visitGroupLayer(const TmxLayers &map, const TmxGroupLayer &layer)
Visit a group layer.
Vector2u tileSize
The size of the tiles.
Definition: Tmx.h:621
bool italic
Is the text in italic?
Definition: Tmx.h:446
#define GF_API
Definition: Portability.h:35
A layer with tiles in cells.
Definition: Tmx.h:328
std::array< unsigned, 4 > terrain
The terrain if the corners (top-left, top-right, bottom-left, bottom-right)
Definition: Tmx.h:559
std::unique_ptr< TmxImage > image
The image of the tileset.
Definition: Tmx.h:584
std::vector< TmxCell > cells
The cells of the layer.
Definition: Tmx.h:329
A polyline object.
Definition: Tmx.h:371
bool loadFromFile(const Path &filename)
Load a TMX file.
virtual void visitObjectLayer(const TmxLayers &map, const TmxObjectLayer &layer)
Visit an object layer.
A layer with other layers.
Definition: Tmx.h:512
bool strikeout
Is the text striked out?
Definition: Tmx.h:448
Time duration
Definition: Tmx.h:526
std::string name
The name of the layer.
Definition: Tmx.h:297
void addBoolProperty(std::string name, bool value)
Add a boolean property.
A polygon object.
Definition: Tmx.h:430
bool visible
The visibility of the layer.
Definition: Tmx.h:299
A top vertical alignment.
Color4u getColorProperty(const std::string &name, const Color4u &def) const
Get a color property.
TmxProperties properties
The properties of the layer.
Definition: Tmx.h:296
virtual void accept(const TmxLayers &map, TmxVisitor &visitor) const override
Accept function in the visitor pattern.
bool underline
Is the text underlined?
Definition: Tmx.h:447
std::vector< Vector2i > points
The points of the polyline.
Definition: Tmx.h:421
An orthogonal orientation.
A reference to an image.
Definition: Tmx.h:490