Skip to content
reduz edited this page Feb 23, 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&#95tile ( int id )

Create a new tile, the ID must be specified.

  • void tile&#95set&#95name ( int id, String name )

Set the name of a tile, for decriptive purposes.

  • String tile&#95get&#95name ( int id ) const

Return the name of a tile, for decriptive purposes.

  • void tile&#95set&#95texture ( int id, Texture texture )

Set the texture of the tile.

Return the texture of the tile.

  • void tile&#95set&#95offset ( int id, Vector2 offset )

Set the offset to draw the tile.

Return the offset to draw the tile.

  • void tile&#95set&#95region ( int id, Rect2 region )

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

  • Rect2 tile&#95get&#95region ( int id ) const

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

  • void tile&#95set&#95shape ( int id, Shape2D shape )

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

Return the shape of the tile.

  • void remove&#95tile ( int id )

Remove a tile, by integer id.

  • void clear ( )

Clear all tiles.

  • int get&#95last&#95unused&#95tile&#95id ( ) const

Find an empty id for creating a new tile.

  • int find&#95tile&#95by&#95name ( String name ) const

Find the first tile with the given name.

Clone this wiki locally