class
#include <ldtk_layer.h>
layer
Public functions
- auto find_entity(gen::entity_iid iid) const -> const entity& constexpr
- Linear searches an entity with its Instance id.
-
auto def() const -> const layer_
definition& constexpr - Reference to the Layer definition.
-
auto tileset_def() const -> const tileset_
definition* constexpr - (Only Tile layers, Auto-layers) Reference to the corresponding Tileset
- auto c_size() const -> const bn::size& constexpr
- Grid-based size.
- auto c_width() const -> int constexpr
- Grid-based width.
- auto c_height() const -> int constexpr
- Grid-based height.
- auto grid_size() const -> int constexpr
- Grid size.
- auto identifier() const -> gen::layer_ident constexpr
- Layer definition identifier.
- auto opacity() const -> bn::fixed constexpr
- Layer opacity as Fixed [0-1].
- auto px_total_offset() const -> const bn::point& constexpr
- Total layer pixel offset, including both instance and definition offsets.
- auto px_total_offset_x() const -> int constexpr
- Total layer X pixel offset, including both instance and definition offsets.
- auto px_total_offset_y() const -> int constexpr
- Total layer Y pixel offset, including both instance and definition offsets.
-
auto type() const -> layer_
type constexpr - Layer type.
-
auto auto_layer_tiles() const -> const tile_
grid_ base* constexpr - (Only Auto-layers) An array containing all tiles generated by Auto-layer rules. The array is already sorted in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).
-
auto grid_tiles() const -> const tile_
grid_ base* constexpr - (Only Tile layers)
-
auto int_grid() const -> const int_
grid_ base* constexpr - (Only IntGrid layers) A list of all values in the IntGrid layer.
0 means "empty cell" and IntGrid values start at 1.
The size isc_
xwidth() c_
cells.height() - auto entity_instances() const -> const bn::span<const entity>& constexpr
- (Only Entity layers)
- auto iid() const -> gen::layer_iid constexpr
- Unique layer instance id.
- auto visible() const -> bool constexpr
- Layer instance visibility.
Function documentation
const entity& ldtk:: layer:: find_entity(gen::entity_iid iid) const constexpr
Linear searches an entity with its Instance id.
Parameters | |
---|---|
iid | Instance id of the entity to search for. |
Returns | Reference to the found entity. |
const tile_ grid_ base* ldtk:: layer:: auto_layer_tiles() const constexpr
(Only Auto-layers) An array containing all tiles generated by Auto-layer rules. The array is already sorted in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).