Skip to content
Modar Nasser edited this page Jun 19, 2024 · 1 revision

In file LDtkLoader/Tile.hpp

Class : ldtk::Tile

Represents a tile on a Layer

Fields

layer

const ldtk::Layer* const ldtk::Tile::layer

Pointer to the Layer object that contains the Tile.

๐Ÿ”

coordId

const int ldtk::Tile::coordId

Coordinate ID of the Tile. Used to retrieve grid position of the Tile.

๐Ÿ”

tileId

const int ldtk::Tile::tileId

Unique ID that identifies the Tile on its Tileset.

๐Ÿ”

flipX

const bool ldtk::Tile::flipX

Equals true if the Tile is flipped alongside the X axis. Equals false otherwise.

๐Ÿ”

flipY

const bool ldtk::Tile::flipY

Equals true if the Tile is flipped alongside the Y axis. Equals false otherwise.

๐Ÿ”

alpha

const float ldtk::Tile::alpha

A value between 0.0 and 1.0 that represnets the opacity of the Tile.

๐Ÿ”

Methods

getPosition

ldtk::Tile::getPosition() const -> ldtk::IntPoint

Returns the position of the Tile in pixels, relatively to the Level (i.e. after applying Layer offset).

๐Ÿ”

getGridPosition

ldtk::Tile::getGridPosition() const -> ldtk::IntPoint

Returns the grid position of the Tile.

๐Ÿ”

getWorldPosition

ldtk::Tile::getWorldPosition() const -> ldtk::IntPoint

Returns the position of the Tile in pixels, relatively to the World (i.e. after applying Layer and Level offsets).

๐Ÿ”

getTextureRect

ldtk::Tile::getTextureRect() const -> ldtk::IntRect

Returns the IntRect corresponding to the Tile area on the Tileset texture.

๐Ÿ”

getVertices

ldtk::Tile::getVertices() const -> std::array<ldtk::Vertex, 4>

Returns an array containing 4 vertices, corresponding the graphical representation of a Tile quad.

See Vertex.

๐Ÿ”

Clone this wiki locally