TileSet

Inherited: Resource

Description

TileSet is a resource class used to define and manage collections of individual tiles. These tiles are typically used in conjunction with a TileMap to create complex game layouts.

Public Methods

int

columns () const

Vector4

getCorners (int index)

void

setColumns (int columns)

void

setSpriteSheet (Sprite * sprite)

void

setTileHeight (int height)

void

setTileMargin (int margin)

void

setTileOffset (const Vector2 offset)

void

setTileSpacing (int spacing)

void

setTileWidth (int width)

void

setType (int type)

Sprite *

spriteSheet () const

int

tileHeight () const

int

tileMargin () const

Vector2

tileOffset () const

int

tileSpacing () const

int

tileWidth () const

int

type () const

Static Methods

None

Methods Description

int TileSet::columns () const

Returns the number of columns in the tileset.

See also setColumns().


Vector4 TileSet::getCorners (int index)

Calculates and returns the texture coordinates (corners) of a specific tile within the tileset based on its index. This method considers tile flipping (horizontal and vertical) if applicable.


void TileSet::setColumns (int columns)

Sets the number of columns in the tileset.

See also *columns*().


void TileSet::setSpriteSheet (Sprite * sprite)

Sets the sprite sheet containing the individual tiles.

See also *sprite*Sheet().


void TileSet::setTileHeight (int height)

Sets the height of an individual tile in pixels.

See also tileHeight().


void TileSet::setTileMargin (int margin)

Sets the margin (border) around the tiles in pixels.

See also tileMargin().


void TileSet::setTileOffset (Vector2 offset)

Sets the offset used for tile positioning.

See also tileOffset().


void TileSet::setTileSpacing (int spacing)

Sets the spacing (gap) between adjacent tiles in pixels.

See also tileSpacing().


void TileSet::setTileWidth (int width)

Sets the width of an individual tile in pixels.

See also tileWidth().


void TileSet::setType (int type)

Sets the type of the tileset, specifying the orientation or layout style of the tiles.

See also *type*().


:ref:`Sprite<api_Sprite>`* TileSet::spriteSheet () const

Returns a pointer to the sprite sheet containing the individual tiles.

See also setSpriteSheet().


int TileSet::tileHeight () const

Returns the height of an individual tile in pixels.

See also setTileHeight().


int TileSet::tileMargin () const

Returns the margin (border) around the tiles in pixels.

See also setTileMargin().


Vector2 TileSet::tileOffset () const

Returns the offset used for tile positioning.

See also setTileOffset().


int TileSet::tileSpacing () const

Returns the spacing (gap) between adjacent tiles in pixels.

See also setTileSpacing().


int TileSet::tileWidth () const

Returns the width of an individual tile in pixels.

See also setTileWidth().


int TileSet::type () const

Returns the type of the tileset. This can represent the orientation or layout style of the tiles.

See also setType().