Debian Codegraph @

doc/classes/TileData.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="TileData" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Settings for a single tile in a [TileSet].
5 </brief_description>
6 <description>
7 [TileData] object represents a single tile in a [TileSet]. It is usually edited using the tileset editor, but it can be modified at runtime using [method TileMapLayer._tile_data_runtime_update].
8 </description>
9 <tutorials>
10 </tutorials>
11 <methods>
12 <method name="add_collision_polygon">
13 <return type="void" />
14 <param index="0" name="layer_id" type="int" />
15 <description>
16 Adds a collision polygon to the tile on the given TileSet physics layer.
17 </description>
18 </method>
19 <method name="add_occluder_polygon">
20 <return type="void" />
21 <param index="0" name="layer_id" type="int" />
22 <description>
23 Adds an occlusion polygon to the tile on the TileSet occlusion layer with index [param layer_id].
24 </description>
25 </method>
26 <method name="get_collision_polygon_one_way_margin" qualifiers="const">
27 <return type="float" />
28 <param index="0" name="layer_id" type="int" />
29 <param index="1" name="polygon_index" type="int" />
30 <description>
31 Returns the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
32 </description>
33 </method>
34 <method name="get_collision_polygon_points" qualifiers="const">
35 <return type="PackedVector2Array" />
36 <param index="0" name="layer_id" type="int" />
37 <param index="1" name="polygon_index" type="int" />
38 <description>
39 Returns the points of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
40 </description>
41 </method>
42 <method name="get_collision_polygons_count" qualifiers="const">
43 <return type="int" />
44 <param index="0" name="layer_id" type="int" />
45 <description>
46 Returns how many polygons the tile has for TileSet physics layer with index [param layer_id].
47 </description>
48 </method>
49 <method name="get_constant_angular_velocity" qualifiers="const">
50 <return type="float" />
51 <param index="0" name="layer_id" type="int" />
52 <description>
53 Returns the constant angular velocity applied to objects colliding with this tile.
54 </description>
55 </method>
56 <method name="get_constant_linear_velocity" qualifiers="const">
57 <return type="Vector2" />
58 <param index="0" name="layer_id" type="int" />
59 <description>
60 Returns the constant linear velocity applied to objects colliding with this tile.
61 </description>
62 </method>
63 <method name="get_custom_data" qualifiers="const">
64 <return type="Variant" />
65 <param index="0" name="layer_name" type="String" />
66 <description>
67 Returns the custom data value for custom data layer named [param layer_name]. To check if a custom data layer exists, use [method has_custom_data].
68 </description>
69 </method>
70 <method name="get_custom_data_by_layer_id" qualifiers="const">
71 <return type="Variant" />
72 <param index="0" name="layer_id" type="int" />
73 <description>
74 Returns the custom data value for custom data layer with index [param layer_id].
75 </description>
76 </method>
77 <method name="get_navigation_polygon" qualifiers="const">
78 <return type="NavigationPolygon" />
79 <param index="0" name="layer_id" type="int" />
80 <param index="1" name="flip_h" type="bool" default="false" />
81 <param index="2" name="flip_v" type="bool" default="false" />
82 <param index="3" name="transpose" type="bool" default="false" />
83 <description>
84 Returns the navigation polygon of the tile for the TileSet navigation layer with index [param layer_id].
85 [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
86 </description>
87 </method>
88 <method name="get_occluder" qualifiers="const" deprecated="Use [method get_occluder_polygon] instead.">
89 <return type="OccluderPolygon2D" />
90 <param index="0" name="layer_id" type="int" />
91 <param index="1" name="flip_h" type="bool" default="false" />
92 <param index="2" name="flip_v" type="bool" default="false" />
93 <param index="3" name="transpose" type="bool" default="false" />
94 <description>
95 Returns the occluder polygon of the tile for the TileSet occlusion layer with index [param layer_id].
96 [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
97 </description>
98 </method>
99 <method name="get_occluder_polygon" qualifiers="const">
100 <return type="OccluderPolygon2D" />
101 <param index="0" name="layer_id" type="int" />
102 <param index="1" name="polygon_index" type="int" />
103 <param index="2" name="flip_h" type="bool" default="false" />
104 <param index="3" name="flip_v" type="bool" default="false" />
105 <param index="4" name="transpose" type="bool" default="false" />
106 <description>
107 Returns the occluder polygon at index [param polygon_index] from the TileSet occlusion layer with index [param layer_id].
108 The [param flip_h], [param flip_v], and [param transpose] parameters can be [code]true[/code] to transform the returned polygon.
109 </description>
110 </method>
111 <method name="get_occluder_polygons_count" qualifiers="const">
112 <return type="int" />
113 <param index="0" name="layer_id" type="int" />
114 <description>
115 Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index [param layer_id].
116 </description>
117 </method>
118 <method name="get_terrain_peering_bit" qualifiers="const">
119 <return type="int" />
120 <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
121 <description>
122 Returns the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
123 </description>
124 </method>
125 <method name="has_custom_data" qualifiers="const">
126 <return type="bool" />
127 <param index="0" name="layer_name" type="String" />
128 <description>
129 Returns whether there exists a custom data layer named [param layer_name].
130 </description>
131 </method>
132 <method name="is_collision_polygon_one_way" qualifiers="const">
133 <return type="bool" />
134 <param index="0" name="layer_id" type="int" />
135 <param index="1" name="polygon_index" type="int" />
136 <description>
137 Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
138 </description>
139 </method>
140 <method name="is_valid_terrain_peering_bit" qualifiers="const">
141 <return type="bool" />
142 <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
143 <description>
144 Returns whether the given [param peering_bit] direction is valid for this tile.
145 </description>
146 </method>
147 <method name="remove_collision_polygon">
148 <return type="void" />
149 <param index="0" name="layer_id" type="int" />
150 <param index="1" name="polygon_index" type="int" />
151 <description>
152 Removes the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
153 </description>
154 </method>
155 <method name="remove_occluder_polygon">
156 <return type="void" />
157 <param index="0" name="layer_id" type="int" />
158 <param index="1" name="polygon_index" type="int" />
159 <description>
160 Removes the polygon at index [param polygon_index] for TileSet occlusion layer with index [param layer_id].
161 </description>
162 </method>
163 <method name="set_collision_polygon_one_way">
164 <return type="void" />
165 <param index="0" name="layer_id" type="int" />
166 <param index="1" name="polygon_index" type="int" />
167 <param index="2" name="one_way" type="bool" />
168 <description>
169 Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
170 </description>
171 </method>
172 <method name="set_collision_polygon_one_way_margin">
173 <return type="void" />
174 <param index="0" name="layer_id" type="int" />
175 <param index="1" name="polygon_index" type="int" />
176 <param index="2" name="one_way_margin" type="float" />
177 <description>
178 Sets the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
179 </description>
180 </method>
181 <method name="set_collision_polygon_points">
182 <return type="void" />
183 <param index="0" name="layer_id" type="int" />
184 <param index="1" name="polygon_index" type="int" />
185 <param index="2" name="polygon" type="PackedVector2Array" />
186 <description>
187 Sets the points of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
188 </description>
189 </method>
190 <method name="set_collision_polygons_count">
191 <return type="void" />
192 <param index="0" name="layer_id" type="int" />
193 <param index="1" name="polygons_count" type="int" />
194 <description>
195 Sets the polygons count for TileSet physics layer with index [param layer_id].
196 </description>
197 </method>
198 <method name="set_constant_angular_velocity">
199 <return type="void" />
200 <param index="0" name="layer_id" type="int" />
201 <param index="1" name="velocity" type="float" />
202 <description>
203 Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
204 </description>
205 </method>
206 <method name="set_constant_linear_velocity">
207 <return type="void" />
208 <param index="0" name="layer_id" type="int" />
209 <param index="1" name="velocity" type="Vector2" />
210 <description>
211 Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts.
212 </description>
213 </method>
214 <method name="set_custom_data">
215 <return type="void" />
216 <param index="0" name="layer_name" type="String" />
217 <param index="1" name="value" type="Variant" />
218 <description>
219 Sets the tile's custom data value for the TileSet custom data layer with name [param layer_name].
220 </description>
221 </method>
222 <method name="set_custom_data_by_layer_id">
223 <return type="void" />
224 <param index="0" name="layer_id" type="int" />
225 <param index="1" name="value" type="Variant" />
226 <description>
227 Sets the tile's custom data value for the TileSet custom data layer with index [param layer_id].
228 </description>
229 </method>
230 <method name="set_navigation_polygon">
231 <return type="void" />
232 <param index="0" name="layer_id" type="int" />
233 <param index="1" name="navigation_polygon" type="NavigationPolygon" />
234 <description>
235 Sets the navigation polygon for the TileSet navigation layer with index [param layer_id].
236 </description>
237 </method>
238 <method name="set_occluder" deprecated="Use [method set_occluder_polygon] instead.">
239 <return type="void" />
240 <param index="0" name="layer_id" type="int" />
241 <param index="1" name="occluder_polygon" type="OccluderPolygon2D" />
242 <description>
243 Sets the occluder for the TileSet occlusion layer with index [param layer_id].
244 </description>
245 </method>
246 <method name="set_occluder_polygon">
247 <return type="void" />
248 <param index="0" name="layer_id" type="int" />
249 <param index="1" name="polygon_index" type="int" />
250 <param index="2" name="polygon" type="OccluderPolygon2D" />
251 <description>
252 Sets the occluder for polygon with index [param polygon_index] in the TileSet occlusion layer with index [param layer_id].
253 </description>
254 </method>
255 <method name="set_occluder_polygons_count">
256 <return type="void" />
257 <param index="0" name="layer_id" type="int" />
258 <param index="1" name="polygons_count" type="int" />
259 <description>
260 Sets the occluder polygon count in the TileSet occlusion layer with index [param layer_id].
261 </description>
262 </method>
263 <method name="set_terrain_peering_bit">
264 <return type="void" />
265 <param index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" />
266 <param index="1" name="terrain" type="int" />
267 <description>
268 Sets the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
269 </description>
270 </method>
271 </methods>
272 <members>
273 <member name="flip_h" type="bool" setter="set_flip_h" getter="get_flip_h" default="false">
274 If [code]true[/code], the tile will have its texture flipped horizontally.
275 </member>
276 <member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false">
277 If [code]true[/code], the tile will have its texture flipped vertically.
278 </member>
279 <member name="material" type="Material" setter="set_material" getter="get_material">
280 The [Material] to use for this [TileData]. This can be a [CanvasItemMaterial] to use the default shader, or a [ShaderMaterial] to use a custom shader.
281 </member>
282 <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)" keywords="color, colour">
283 Color modulation of the tile.
284 </member>
285 <member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0">
286 Relative probability of this tile being selected when drawing a pattern of random tiles.
287 </member>
288 <member name="terrain" type="int" setter="set_terrain" getter="get_terrain" default="-1">
289 ID of the terrain from the terrain set that the tile uses.
290 </member>
291 <member name="terrain_set" type="int" setter="set_terrain_set" getter="get_terrain_set" default="-1">
292 ID of the terrain set that the tile uses.
293 </member>
294 <member name="texture_origin" type="Vector2i" setter="set_texture_origin" getter="get_texture_origin" default="Vector2i(0, 0)">
295 Offsets the position of where the tile is drawn.
296 </member>
297 <member name="transpose" type="bool" setter="set_transpose" getter="get_transpose" default="false">
298 If [code]true[/code], the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped.
299 </member>
300 <member name="y_sort_origin" type="int" setter="set_y_sort_origin" getter="get_y_sort_origin" default="0">
301 Vertical point of the tile used for determining y-sorted order.
302 </member>
303 <member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0">
304 Ordering index of this tile, relative to [TileMapLayer].
305 </member>
306 </members>
307 <signals>
308 <signal name="changed">
309 <description>
310 Emitted when any of the properties are changed.
311 </description>
312 </signal>
313 </signals>
314 </class>