Skip to content
reduz edited this page Feb 25, 2014 · 15 revisions

TileSet

####Inherits: Resource ####Category: Core

Brief Description

Tile library for tilemaps.

Member Functions

Description

A TileSet is a library of tiles for a TileMap. It contains a list of tiles, each consisting of a sprite and optional collision shapes.

Member Function Description

  • void create_tile ( int id )

Create a new tile, the ID must be specified.

Set the name of a tile, for decriptive purposes.

Return the name of a tile, for decriptive purposes.

  • void tile_set_texture ( int id, Texture texture )

Set the texture of the tile.

Return the texture of the tile.

  • void tile_set_region ( int id, Rect2 region )

Set the tile sub-region in the texture. This is common in texture atlases.

  • Rect2 tile_get_region ( int id ) const

Return the tile sub-region in the texture. This is common in texture atlases.

Set a shape for the tile, enabling physics to collide it.

Return the shape of the tile.

  • void remove_tile ( int id )

Remove a tile, by integer id.

  • void clear ( )

Clear all tiles.

  • int get_last_unused_tile_id ( ) const

Find an empty id for creating a new tile.

  • int find_tile_by_name ( String name ) const

Find the first tile with the given name.

Clone this wiki locally