TileSet

Tile library for tilemaps.

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. Tiles are referenced by a unique integer ID.

@GodotBaseClass
struct TileSet {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

AutotileBindings
enum AutotileBindings
BitmaskMode
enum BitmaskMode
Constants
enum Constants
TileMode
enum TileMode

Functions

_forwardAtlasSubtileSelection
Vector2 _forwardAtlasSubtileSelection(long atlastile_id, GodotObject tilemap, Vector2 tile_location)
_forwardSubtileSelection
Vector2 _forwardSubtileSelection(long autotile_id, long bitmask, GodotObject tilemap, Vector2 tile_location)
_isTileBound
bool _isTileBound(long drawn_id, long neighbor_id)

Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. Note: neighbor_id will be -1 (constant TileMap.INVALID_CELL) when checking a tile against an empty neighbor tile.

autotileClearBitmaskMap
void autotileClearBitmaskMap(long id)

Clears all bitmask information of the autotile.

autotileGetBitmask
long autotileGetBitmask(long id, Vector2 coord)

Returns the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in autotilebindings present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).

autotileGetBitmaskMode
TileSet.BitmaskMode autotileGetBitmaskMode(long id)

Returns the bitmaskmode of the autotile.

autotileGetIconCoordinate
Vector2 autotileGetIconCoordinate(long id)

Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.

autotileGetLightOccluder
Ref!OccluderPolygon2D autotileGetLightOccluder(long id, Vector2 coord)

Returns the light occluder of the subtile from an atlas/autotile given its coordinates.

autotileGetNavigationPolygon
Ref!NavigationPolygon autotileGetNavigationPolygon(long id, Vector2 coord)

Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates.

autotileGetSize
Vector2 autotileGetSize(long id)

Returns the size of the subtiles in an atlas/autotile.

autotileGetSpacing
long autotileGetSpacing(long id)

Returns the spacing between subtiles of the atlas/autotile.

autotileGetSubtilePriority
long autotileGetSubtilePriority(long id, Vector2 coord)

Returns the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.

autotileGetZIndex
long autotileGetZIndex(long id, Vector2 coord)

Returns the drawing index of the subtile from an atlas/autotile given its coordinates.

autotileSetBitmask
void autotileSetBitmask(long id, Vector2 bitmask, long flag)

Sets the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in autotilebindings present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).

autotileSetBitmaskMode
void autotileSetBitmaskMode(long id, long mode)

Sets the bitmaskmode of the autotile.

autotileSetIconCoordinate
void autotileSetIconCoordinate(long id, Vector2 coord)

Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.

autotileSetLightOccluder
void autotileSetLightOccluder(long id, OccluderPolygon2D light_occluder, Vector2 coord)

Sets the light occluder of the subtile from an atlas/autotile given its coordinates.

autotileSetNavigationPolygon
void autotileSetNavigationPolygon(long id, NavigationPolygon navigation_polygon, Vector2 coord)

Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates.

autotileSetSize
void autotileSetSize(long id, Vector2 size)

Sets the size of the subtiles in an atlas/autotile.

autotileSetSpacing
void autotileSetSpacing(long id, long spacing)

Sets the spacing between subtiles of the atlas/autotile.

autotileSetSubtilePriority
void autotileSetSubtilePriority(long id, Vector2 coord, long priority)

Sets the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.

autotileSetZIndex
void autotileSetZIndex(long id, Vector2 coord, long z_index)

Sets the drawing index of the subtile from an atlas/autotile given its coordinates.

clear
void clear()

Clears all tiles.

createTile
void createTile(long id)

Creates a new tile with the given ID.

findTileByName
long findTileByName(String name)

Returns the first tile matching the given name.

getLastUnusedTileId
long getLastUnusedTileId()

Returns the ID following the last currently used ID, useful when creating a new tile.

getTilesIds
Array getTilesIds()

Returns an array of all currently used tile IDs.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(TileSet other)
opEquals
bool opEquals(typeof(null) n)
removeTile
void removeTile(long id)

Removes the given tile ID.

tileAddShape
void tileAddShape(long id, Shape2D shape, Transform2D shape_transform, bool one_way, Vector2 autotile_coord)

Adds a shape to the tile.

tileGetLightOccluder
Ref!OccluderPolygon2D tileGetLightOccluder(long id)

Returns the tile's light occluder.

tileGetMaterial
Ref!ShaderMaterial tileGetMaterial(long id)

Returns the tile's material.

tileGetModulate
Color tileGetModulate(long id)

Returns the tile's modulation color.

tileGetName
String tileGetName(long id)

Returns the tile's name.

tileGetNavigationPolygon
Ref!NavigationPolygon tileGetNavigationPolygon(long id)

Returns the navigation polygon of the tile.

tileGetNavigationPolygonOffset
Vector2 tileGetNavigationPolygonOffset(long id)

Returns the offset of the tile's navigation polygon.

tileGetNormalMap
Ref!Texture tileGetNormalMap(long id)

Returns the tile's normal map texture.

tileGetOccluderOffset
Vector2 tileGetOccluderOffset(long id)

Returns the offset of the tile's light occluder.

tileGetRegion
Rect2 tileGetRegion(long id)

Returns the tile sub-region in the texture.

tileGetShape
Ref!Shape2D tileGetShape(long id, long shape_id)

Returns a tile's given shape.

tileGetShapeCount
long tileGetShapeCount(long id)

Returns the number of shapes assigned to a tile.

tileGetShapeOffset
Vector2 tileGetShapeOffset(long id, long shape_id)

Returns the offset of a tile's shape.

tileGetShapeOneWay
bool tileGetShapeOneWay(long id, long shape_id)

Returns the one-way collision value of a tile's shape.

tileGetShapeOneWayMargin
double tileGetShapeOneWayMargin(long id, long shape_id)
tileGetShapeTransform
Transform2D tileGetShapeTransform(long id, long shape_id)

Returns the Transform2D of a tile's shape.

tileGetShapes
Array tileGetShapes(long id)

Returns an array of dictionaries describing the tile's shapes. Dictionary structure in the array returned by this method:

tileGetTexture
Ref!Texture tileGetTexture(long id)

Returns the tile's texture.

tileGetTextureOffset
Vector2 tileGetTextureOffset(long id)

Returns the texture offset of the tile.

tileGetTileMode
TileSet.TileMode tileGetTileMode(long id)

Returns the tile's tilemode.

tileGetZIndex
long tileGetZIndex(long id)

Returns the tile's Z index (drawing layer).

tileSetLightOccluder
void tileSetLightOccluder(long id, OccluderPolygon2D light_occluder)

Sets a light occluder for the tile.

tileSetMaterial
void tileSetMaterial(long id, ShaderMaterial material)

Sets the tile's material.

tileSetModulate
void tileSetModulate(long id, Color color)

Sets the tile's modulation color.

tileSetName
void tileSetName(long id, String name)

Sets the tile's name.

tileSetNavigationPolygon
void tileSetNavigationPolygon(long id, NavigationPolygon navigation_polygon)

Sets the tile's navigation polygon.

tileSetNavigationPolygonOffset
void tileSetNavigationPolygonOffset(long id, Vector2 navigation_polygon_offset)

Sets an offset for the tile's navigation polygon.

tileSetNormalMap
void tileSetNormalMap(long id, Texture normal_map)

Sets the tile's normal map texture. Note: Godot expects the normal map to use X+, Y-, and Z+ coordinates. See url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinatesthis page/url for a comparison of normal map coordinates expected by popular engines.

tileSetOccluderOffset
void tileSetOccluderOffset(long id, Vector2 occluder_offset)

Sets an offset for the tile's light occluder.

tileSetRegion
void tileSetRegion(long id, Rect2 region)

Sets the tile's sub-region in the texture. This is common in texture atlases.

tileSetShape
void tileSetShape(long id, long shape_id, Shape2D shape)

Sets a shape for the tile, enabling collision.

tileSetShapeOffset
void tileSetShapeOffset(long id, long shape_id, Vector2 shape_offset)

Sets the offset of a tile's shape.

tileSetShapeOneWay
void tileSetShapeOneWay(long id, long shape_id, bool one_way)

Enables one-way collision on a tile's shape.

tileSetShapeOneWayMargin
void tileSetShapeOneWayMargin(long id, long shape_id, double one_way)
tileSetShapeTransform
void tileSetShapeTransform(long id, long shape_id, Transform2D shape_transform)

Sets a Transform2D on a tile's shape.

tileSetShapes
void tileSetShapes(long id, Array shapes)

Sets an array of shapes for the tile, enabling collision.

tileSetTexture
void tileSetTexture(long id, Texture texture)

Sets the tile's texture.

tileSetTextureOffset
void tileSetTextureOffset(long id, Vector2 texture_offset)

Sets the tile's texture offset.

tileSetTileMode
void tileSetTileMode(long id, long tilemode)

Sets the tile's tilemode.

tileSetZIndex
void tileSetZIndex(long id, long z_index)

Sets the tile's drawing index.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
TileSet _new()

Construct a new instance of TileSet. Note: use memnew!TileSet instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta