Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::render::Tileset Struct Reference

Image cut into tiles; its tiles are the global ids first_gid to first_gid + tile_count - 1. More...

#include <aegis2d/render/tile_map.hpp>

Public Member Functions

PixelRect tile (std::uint32_t index) const
 Rectangle of a tile in the image.
 

Public Attributes

std::uint32_t first_gid = 1
 Global id of its first tile.
 
std::string name {}
 Name given in Tiled.
 
std::filesystem::path image {}
 Image file, resolved from the folder of the file that names it.
 
TextureSize image_size {}
 Size of the image.
 
TextureSize tile_size {}
 Size of one tile.
 
std::uint32_t tile_count = 0
 Number of tiles.
 
int columns = 0
 Tiles per row.
 
int margin = 0
 Pixels around the tiles.
 
int spacing = 0
 Pixels between two tiles.
 
TileProperties properties {}
 Custom properties.
 

Detailed Description

Image cut into tiles; its tiles are the global ids first_gid to first_gid + tile_count - 1.

Member Function Documentation

◆ tile()

PixelRect aegis2d::render::Tileset::tile ( std::uint32_t  index) const

Rectangle of a tile in the image.

Parameters
indexTile number in this tileset, from 0 (gid - first_gid).
Returns
The tile, in pixels.
Exceptions
std::out_of_rangeif index is not below tile_count.

Member Data Documentation

◆ columns

int aegis2d::render::Tileset::columns = 0

Tiles per row.

◆ first_gid

std::uint32_t aegis2d::render::Tileset::first_gid = 1

Global id of its first tile.

◆ image

std::filesystem::path aegis2d::render::Tileset::image {}

Image file, resolved from the folder of the file that names it.

◆ image_size

TextureSize aegis2d::render::Tileset::image_size {}

Size of the image.

◆ margin

int aegis2d::render::Tileset::margin = 0

Pixels around the tiles.

◆ name

std::string aegis2d::render::Tileset::name {}

Name given in Tiled.

◆ properties

TileProperties aegis2d::render::Tileset::properties {}

Custom properties.

◆ spacing

int aegis2d::render::Tileset::spacing = 0

Pixels between two tiles.

◆ tile_count

std::uint32_t aegis2d::render::Tileset::tile_count = 0

Number of tiles.

◆ tile_size

TextureSize aegis2d::render::Tileset::tile_size {}

Size of one tile.


The documentation for this struct was generated from the following file: