ldtk::project class

Public functions

auto get_level(gen::level_ident identifier) const -> const level& constexpr
Looks up a level with its identifier.
auto find_level(gen::level_iid iid) const -> const level& constexpr
Linear searches a level with its Instance id.
auto defs() const -> const definitions& constexpr
A structure containing all the definitions of this project.
auto iid() const -> gen::project_iid constexpr
Unique project identifier.
auto levels() const -> const bn::span<const level>& constexpr
All levels. The order of this array is only relevant in linear_horizontal and linear_vertical world layouts (see worldLayout value).
Otherwise, you should refer to the world_x,world_y coordinates of each Level.
auto bg_color() const -> bn::color constexpr
Project background color.
auto opacity() const -> bn::fixed constexpr
Global opacity used for semi-transparent layers.

Function documentation

const level& ldtk::project::get_level(gen::level_ident identifier) const constexpr

Looks up a level with its identifier.

Parameters
identifier Unique identifier of the level to look up.
Returns Reference to the level.

const level& ldtk::project::find_level(gen::level_iid iid) const constexpr

Linear searches a level with its Instance id.

Parameters
iid Instance id of the level to search for.
Returns Reference to the found level.