Skip to content
Modar Nasser edited this page Jun 19, 2024 · 21 revisions

In file LDtkLoader/World.hpp

Class : ldtk::World

A World represents one world in the LDtk project and can contain one or multiple levels.

Fields

iid

const std::string ldtk::World::iid

Unique instance ID of the World.

🔝

Methods

getName

ldtk::World::getName() const -> const std::string&

Returns the name of the World.

🔝

getDefaultPivot

ldtk::World::getDefaultPivot() const -> const ldtk::FloatPoint&

Returns the default pivot, a point from (0.f, 0.f) to (1.f, 1.f).

🔝

getDefaultCellSize

ldtk::World::getDefaultCellSize() const -> int

Returns the default size of a cell in the World grid. Cell dimension is be sizexsize.

🔝

getBgColor

ldtk::World::getBgColor() const -> const ldtk::Color&

Returns the default background color of the World.

🔝

getLayout

ldtk::World::getLayout() const -> const ldtk::WorldLayout&

Returns the layout of the world (Free, GridVania, LinearHorizontal or LinearVertical).

See WorldLayout enum.

🔝

allTilesets

ldtk::World::allTilesets() const -> const std::vector<ldtk::Tileset>&

Returns a vector containing all the Tilesets of the World.

🔝

getTileset

ldtk::World::getTileset(int id) const -> const ldtk::Tileset&
ldtk::World::getTileset(const std::string& name) const -> const ldtk::Tileset&

Returns the Tileset matching the given id or name.

If no Tileset is found, an invalid_argument exception is thrown.

🔝

allLevels

ldtk::World::allLevels() const -> const std::vector<ldtk::Level>&

Returns a vector containing all the Levels of the World.

🔝

getLevel

ldtk::World::getLevel(int id) const -> const ldtk::Level&
ldtk::World::getLevel(const std::string& name) const -> const ldtk::Level&

Returns the Level matching the given ìd or name.

If no Level is found, an invalid_argument exception is thrown.

🔝

getEnum

ldtk::World::getEnum(int id) const -> const ldtk::Enum&
ldtk::World::getEnum(const std::string& name) const -> const ldtk::Enum&

Returns the Enum matching the given id or name.

If no Enum is found, an invalid_argument exception is thrown.

🔝

getLayerDef

ldtk::World::getLayerDef(int id) const -> const ldtk::LayerDef&
ldtk::World::getLayerDef(const std::string& name) const -> const ldtk::LayerDef&

Returns the LayerDef matching the given id or name.

If no LayerDef is found, an invalid_argument exception is thrown.

🔝

getEntityDef

ldtk::World::getEntityDef(int id) const -> const ldtk::EntityDef&
ldtk::World::getEntityDef(const std::string& name) const -> const ldtk::EntityDef&

Returns the EntityDef matching the given id or name.

If no EntityDef is found, an invalid_argument exception is thrown.

🔝

Clone this wiki locally