Gamedev Framework (gf)  0.9.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 (unsigned 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...
 
TmxOrientation orientation
 The orientation of the map. More...
 
TmxRenderOrder renderOrder
 The render order of the map. More...
 
Vector2u mapSize
 The size of the map. More...
 
Vector2u tileSize
 The size of the tiles. More...
 
unsigned hexSideLength
 The length of the side for hexagonal map. More...
 
TmxStaggerAxis staggerAxis
 The stagger axis for hexagonal map. More...
 
TmxStaggerIndex staggerIndex
 The stagger index for hexagonal map. More...
 
Color4u backgroundColor
 The background color. More...
 
unsigned 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 ( unsigned  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

unsigned gf::TmxLayers::hexSideLength

The length of the side for hexagonal map.

◆ layers

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

The layers of the map.

◆ mapSize

Vector2u gf::TmxLayers::mapSize

The size of the map.

◆ nextObjectId

unsigned gf::TmxLayers::nextObjectId

The next object id.

◆ orientation

TmxOrientation 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.

◆ staggerAxis

TmxStaggerAxis gf::TmxLayers::staggerAxis

The stagger axis for hexagonal map.

◆ staggerIndex

TmxStaggerIndex gf::TmxLayers::staggerIndex

The stagger index for hexagonal 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

Vector2u gf::TmxLayers::tileSize

The size of the tiles.

◆ version

std::string gf::TmxLayers::version

The version of the map.