Gamedev Framework (gf)  0.17.0
A C++14 framework for 2D games
Public Member Functions | Public Attributes | List of all members
gf::TmxLayers Struct Reference

A TMX map. More...

#include <gf/Tmx.h>

Public Member Functions

const TmxTilesetgetTileSetFromGID (int gid) const noexcept
 Get the tileset corresponding to a global id. More...
 
void visitLayers (TmxVisitor &visitor) const
 Visit the layers with a visitor. More...
 
bool loadFromFile (const Path &filename)
 Load a TMX file. More...
 

Public Attributes

TmxProperties properties
 The properties of the map. More...
 
std::string version
 The version of the map. More...
 
std::string tiledVersion
 The tiled version of the map. More...
 
TileOrientation orientation
 The orientation of the map. More...
 
TmxRenderOrder renderOrder
 The render order of the map. More...
 
bool infinite
 Is the map infinite? More...
 
Vector2i mapSize
 The size of the map. More...
 
Vector2i tileSize
 The size of the tiles. More...
 
int hexSideLength
 The length of the side for hexagonal map. More...
 
MapCellAxis mapCellAxis
 The stagger axis for hexagonal map. More...
 
MapCellIndex mapCellIndex
 The stagger index for hexagonal map. More...
 
Color4u backgroundColor
 The background color. More...
 
int nextObjectId
 The next object id. More...
 
std::vector< TmxTilesettilesets
 The tilesets used in the map. More...
 
std::vector< std::unique_ptr< TmxLayer > > layers
 The layers of the map. More...
 

Detailed Description

A TMX map.

Member Function Documentation

◆ getTileSetFromGID()

const TmxTileset* gf::TmxLayers::getTileSetFromGID ( int  gid) const
noexcept

Get the tileset corresponding to a global id.

Parameters
gidA global id
Returns
The corresponding tileset

◆ loadFromFile()

bool gf::TmxLayers::loadFromFile ( const Path filename)

Load a TMX file.

Parameters
filenameThe name of the TMX file

◆ visitLayers()

void gf::TmxLayers::visitLayers ( TmxVisitor visitor) const

Visit the layers with a visitor.

Parameters
visitorthe visitor

Member Data Documentation

◆ backgroundColor

Color4u gf::TmxLayers::backgroundColor

The background color.

◆ hexSideLength

int gf::TmxLayers::hexSideLength

The length of the side for hexagonal map.

◆ infinite

bool gf::TmxLayers::infinite

Is the map infinite?

◆ layers

std::vector<std::unique_ptr<TmxLayer> > gf::TmxLayers::layers

The layers of the map.

◆ mapCellAxis

MapCellAxis gf::TmxLayers::mapCellAxis

The stagger axis for hexagonal map.

◆ mapCellIndex

MapCellIndex gf::TmxLayers::mapCellIndex

The stagger index for hexagonal map.

◆ mapSize

Vector2i gf::TmxLayers::mapSize

The size of the map.

◆ nextObjectId

int gf::TmxLayers::nextObjectId

The next object id.

◆ orientation

TileOrientation gf::TmxLayers::orientation

The orientation of the map.

◆ properties

TmxProperties gf::TmxLayers::properties

The properties of the map.

◆ renderOrder

TmxRenderOrder gf::TmxLayers::renderOrder

The render order of the map.

◆ tiledVersion

std::string gf::TmxLayers::tiledVersion

The tiled version of the map.

◆ tilesets

std::vector<TmxTileset> gf::TmxLayers::tilesets

The tilesets used in the map.

◆ tileSize

Vector2i gf::TmxLayers::tileSize

The size of the tiles.

◆ version

std::string gf::TmxLayers::version

The version of the map.