123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <class name="TileSet" inherits="Resource" category="Core" version="3.1">
- <brief_description>
- Tile library for tilemaps.
- </brief_description>
- <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.
- Tiles are referenced by a unique integer ID.
- </description>
- <tutorials>
- </tutorials>
- <demos>
- </demos>
- <methods>
- <method name="_forward_subtile_selection" qualifiers="virtual">
- <return type="Vector2">
- </return>
- <argument index="0" name="autotile_id" type="int">
- </argument>
- <argument index="1" name="bitmask" type="int">
- </argument>
- <argument index="2" name="tilemap" type="Object">
- </argument>
- <argument index="3" name="tile_location" type="Vector2">
- </argument>
- <description>
- </description>
- </method>
- <method name="_is_tile_bound" qualifiers="virtual">
- <return type="bool">
- </return>
- <argument index="0" name="drawn_id" type="int">
- </argument>
- <argument index="1" name="neighbor_id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="autotile_clear_bitmask_map">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Clears all bitmask info of the autotile.
- </description>
- </method>
- <method name="autotile_get_bitmask">
- <return type="int" enum="TileSet.AutotileBindings">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- Returns the bitmask of the subtile from an autotile given its coordinates.
- The value is the sum of the values in [enum TileSet.AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
- </description>
- </method>
- <method name="autotile_get_bitmask_mode" qualifiers="const">
- <return type="int" enum="TileSet.BitmaskMode">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the [enum TileSet.BitmaskMode] of the autotile.
- </description>
- </method>
- <method name="autotile_get_icon_coordinate" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- 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 info is incomplete. It will also be used to represent it in the TileSet editor.
- </description>
- </method>
- <method name="autotile_get_light_occluder" qualifiers="const">
- <return type="OccluderPolygon2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- Returns the light occluder of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="autotile_get_navigation_polygon" qualifiers="const">
- <return type="NavigationPolygon">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="autotile_get_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the size of the subtiles in an atlas/autotile.
- </description>
- </method>
- <method name="autotile_get_spacing" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the spacing between subtiles of the atlas/autotile.
- </description>
- </method>
- <method name="autotile_get_subtile_priority">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="autotile_get_z_index">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- Returns the drawing index of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="autotile_set_bitmask">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="bitmask" type="Vector2">
- </argument>
- <argument index="2" name="flag" type="int" enum="TileSet.AutotileBindings">
- </argument>
- <description>
- Sets the bitmask of the subtile from an autotile given its coordinates.
- The value is the sum of the values in [enum TileSet.AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
- </description>
- </method>
- <method name="autotile_set_bitmask_mode">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="mode" type="int" enum="TileSet.BitmaskMode">
- </argument>
- <description>
- Sets the [enum TileSet.BitmaskMode] of the autotile.
- </description>
- </method>
- <method name="autotile_set_icon_coordinate">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <description>
- 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 info is incomplete. It will also be used to represent it in the TileSet editor.
- </description>
- </method>
- <method name="autotile_set_light_occluder">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="light_occluder" type="OccluderPolygon2D">
- </argument>
- <argument index="2" name="coord" type="Vector2">
- </argument>
- <description>
- Sets the light occluder of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="autotile_set_navigation_polygon">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="navigation_polygon" type="NavigationPolygon">
- </argument>
- <argument index="2" name="coord" type="Vector2">
- </argument>
- <description>
- Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="autotile_set_size">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="size" type="Vector2">
- </argument>
- <description>
- Sets the size of the subtiles in an atlas/autotile.
- </description>
- </method>
- <method name="autotile_set_spacing">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="spacing" type="int">
- </argument>
- <description>
- Sets the spacing between subtiles of the atlas/autotile.
- </description>
- </method>
- <method name="autotile_set_subtile_priority">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <argument index="2" name="priority" type="int">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="autotile_set_z_index">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="coord" type="Vector2">
- </argument>
- <argument index="2" name="z_index" type="int">
- </argument>
- <description>
- Sets the drawing index of the subtile from an atlas/autotile given its coordinates.
- </description>
- </method>
- <method name="clear">
- <return type="void">
- </return>
- <description>
- Clears all tiles.
- </description>
- </method>
- <method name="create_tile">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Creates a new tile with the given ID.
- </description>
- </method>
- <method name="find_tile_by_name" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Returns the first tile matching the given name.
- </description>
- </method>
- <method name="get_last_unused_tile_id" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the ID following the last currently used ID, useful when creating a new tile.
- </description>
- </method>
- <method name="get_tiles_ids" qualifiers="const">
- <return type="Array">
- </return>
- <description>
- Returns an array of all currently used tile IDs.
- </description>
- </method>
- <method name="remove_tile">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Removes the given tile ID.
- </description>
- </method>
- <method name="tile_add_shape">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape" type="Shape2D">
- </argument>
- <argument index="2" name="shape_transform" type="Transform2D">
- </argument>
- <argument index="3" name="one_way" type="bool" default="false">
- </argument>
- <argument index="4" name="autotile_coord" type="Vector2" default="Vector2( 0, 0 )">
- </argument>
- <description>
- Adds a shape to the tile.
- </description>
- </method>
- <method name="tile_get_light_occluder" qualifiers="const">
- <return type="OccluderPolygon2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's light occluder.
- </description>
- </method>
- <method name="tile_get_material" qualifiers="const">
- <return type="ShaderMaterial">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's material.
- </description>
- </method>
- <method name="tile_get_modulate" qualifiers="const">
- <return type="Color">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's modulation color.
- </description>
- </method>
- <method name="tile_get_name" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's name.
- </description>
- </method>
- <method name="tile_get_navigation_polygon" qualifiers="const">
- <return type="NavigationPolygon">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the navigation polygon of the tile.
- </description>
- </method>
- <method name="tile_get_navigation_polygon_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the offset of the tile's navigation polygon.
- </description>
- </method>
- <method name="tile_get_normal_map" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's normal map texture.
- </description>
- </method>
- <method name="tile_get_occluder_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the offset of the tile's light occluder.
- </description>
- </method>
- <method name="tile_get_region" qualifiers="const">
- <return type="Rect2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile sub-region in the texture.
- </description>
- </method>
- <method name="tile_get_shape" qualifiers="const">
- <return type="Shape2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <description>
- Returns a tile's given shape.
- </description>
- </method>
- <method name="tile_get_shape_count" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the number of shapes assigned to a tile.
- </description>
- </method>
- <method name="tile_get_shape_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <description>
- Returns the offset of a tile's shape.
- </description>
- </method>
- <method name="tile_get_shape_one_way" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <description>
- Returns the one-way collision value of a tile's shape.
- </description>
- </method>
- <method name="tile_get_shape_transform" qualifiers="const">
- <return type="Transform2D">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <description>
- Returns the [Transform2D] of a tile's shape.
- </description>
- </method>
- <method name="tile_get_shapes" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns an array of the tile's shapes.
- </description>
- </method>
- <method name="tile_get_texture" qualifiers="const">
- <return type="Texture">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's texture.
- </description>
- </method>
- <method name="tile_get_texture_offset" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the texture offset of the tile.
- </description>
- </method>
- <method name="tile_get_tile_mode" qualifiers="const">
- <return type="int" enum="TileSet.TileMode">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's [enum TileSet.TileMode].
- </description>
- </method>
- <method name="tile_get_z_index" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- Returns the tile's z-index (drawing layer).
- </description>
- </method>
- <method name="tile_set_light_occluder">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="light_occluder" type="OccluderPolygon2D">
- </argument>
- <description>
- Sets a light occluder for the tile.
- </description>
- </method>
- <method name="tile_set_material">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="material" type="ShaderMaterial">
- </argument>
- <description>
- Sets the tile's material.
- </description>
- </method>
- <method name="tile_set_modulate">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Sets the tile's modulation color.
- </description>
- </method>
- <method name="tile_set_name">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="name" type="String">
- </argument>
- <description>
- Sets the tile's name.
- </description>
- </method>
- <method name="tile_set_navigation_polygon">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="navigation_polygon" type="NavigationPolygon">
- </argument>
- <description>
- Sets the tile's navigation polygon.
- </description>
- </method>
- <method name="tile_set_navigation_polygon_offset">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="navigation_polygon_offset" type="Vector2">
- </argument>
- <description>
- Sets an offset for the tile's navigation polygon.
- </description>
- </method>
- <method name="tile_set_normal_map">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="normal_map" type="Texture">
- </argument>
- <description>
- Sets the tile's normal map texture.
- </description>
- </method>
- <method name="tile_set_occluder_offset">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="occluder_offset" type="Vector2">
- </argument>
- <description>
- Sets an offset for the tile's light occluder.
- </description>
- </method>
- <method name="tile_set_region">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="region" type="Rect2">
- </argument>
- <description>
- Sets the tile's sub-region in the texture. This is common in texture atlases.
- </description>
- </method>
- <method name="tile_set_shape">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <argument index="2" name="shape" type="Shape2D">
- </argument>
- <description>
- Sets a shape for the tile, enabling collision.
- </description>
- </method>
- <method name="tile_set_shape_offset">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <argument index="2" name="shape_offset" type="Vector2">
- </argument>
- <description>
- Sets the offset of a tile's shape.
- </description>
- </method>
- <method name="tile_set_shape_one_way">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <argument index="2" name="one_way" type="bool">
- </argument>
- <description>
- Enables one-way collision on a tile's shape.
- </description>
- </method>
- <method name="tile_set_shape_transform">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shape_id" type="int">
- </argument>
- <argument index="2" name="shape_transform" type="Transform2D">
- </argument>
- <description>
- Sets a [Transform2D] on a tile's shape.
- </description>
- </method>
- <method name="tile_set_shapes">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="shapes" type="Array">
- </argument>
- <description>
- Sets an array of shapes for the tile, enabling collision.
- </description>
- </method>
- <method name="tile_set_texture">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="texture" type="Texture">
- </argument>
- <description>
- Sets the tile's texture.
- </description>
- </method>
- <method name="tile_set_texture_offset">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="texture_offset" type="Vector2">
- </argument>
- <description>
- Sets the tile's texture offset.
- </description>
- </method>
- <method name="tile_set_tile_mode">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="tilemode" type="int" enum="TileSet.TileMode">
- </argument>
- <description>
- Sets the tile's [enum TileSet.TileMode].
- </description>
- </method>
- <method name="tile_set_z_index">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="z_index" type="int">
- </argument>
- <description>
- Sets the tile's drawing index.
- </description>
- </method>
- </methods>
- <constants>
- <constant name="BITMASK_2X2" value="0" enum="BitmaskMode">
- </constant>
- <constant name="BITMASK_3X3_MINIMAL" value="1" enum="BitmaskMode">
- </constant>
- <constant name="BITMASK_3X3" value="2" enum="BitmaskMode">
- </constant>
- <constant name="BIND_TOPLEFT" value="1" enum="AutotileBindings">
- </constant>
- <constant name="BIND_TOP" value="2" enum="AutotileBindings">
- </constant>
- <constant name="BIND_TOPRIGHT" value="4" enum="AutotileBindings">
- </constant>
- <constant name="BIND_LEFT" value="8" enum="AutotileBindings">
- </constant>
- <constant name="BIND_RIGHT" value="32" enum="AutotileBindings">
- </constant>
- <constant name="BIND_BOTTOMLEFT" value="64" enum="AutotileBindings">
- </constant>
- <constant name="BIND_BOTTOM" value="128" enum="AutotileBindings">
- </constant>
- <constant name="BIND_BOTTOMRIGHT" value="256" enum="AutotileBindings">
- </constant>
- <constant name="SINGLE_TILE" value="0" enum="TileMode">
- </constant>
- <constant name="AUTO_TILE" value="1" enum="TileMode">
- </constant>
- <constant name="ATLAS_TILE" value="2" enum="TileMode">
- </constant>
- </constants>
- </class>
|