-
Notifications
You must be signed in to change notification settings - Fork 31
World
A World represents one world in the LDtk project and can contain one or multiple levels.
const std::string ldtk::World::iidUnique instance ID of the World.
getNamegetDefaultPivotgetDefaultCellSizegetBgColorgetLayoutallTilesetsgetTilesetallLevelsgetLevelgetEnumgetLayerDefgetEntityDef
ldtk::World::getName() const -> const std::string&Returns the name of the World.
ldtk::World::getDefaultPivot() const -> const ldtk::FloatPoint&Returns the default pivot, a point from (0.f, 0.f) to (1.f, 1.f).
ldtk::World::getDefaultCellSize() const -> intReturns the default size of a cell in the World grid. Cell dimension is be sizexsize.
ldtk::World::getBgColor() const -> const ldtk::Color&Returns the default background color of the World.
ldtk::World::getLayout() const -> const ldtk::WorldLayout&Returns the layout of the world (Free, GridVania, LinearHorizontal or LinearVertical).
See WorldLayout enum.
ldtk::World::allTilesets() const -> const std::vector<ldtk::Tileset>&Returns a vector containing all the Tilesets of the World.
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.
ldtk::World::allLevels() const -> const std::vector<ldtk::Level>&Returns a vector containing all the Levels of the World.
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.
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.
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.
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.