1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TileSet" inherits="Resource" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<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>
<link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link>
<link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
<link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link>
<link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link>
<link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link>
<link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
<link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link>
</tutorials>
<methods>
<method name="_forward_atlas_subtile_selection" qualifiers="virtual">
<return type="Vector2" />
<argument index="0" name="atlastile_id" type="int" />
<argument index="1" name="tilemap" type="Object" />
<argument index="2" name="tile_location" type="Vector2" />
<description>
</description>
</method>
<method name="_forward_subtile_selection" qualifiers="virtual">
<return type="Vector2" />
<argument index="0" name="autotile_id" type="int" />
<argument index="1" name="bitmask" type="int" />
<argument index="2" name="tilemap" type="Object" />
<argument index="3" name="tile_location" type="Vector2" />
<description>
</description>
</method>
<method name="_is_tile_bound" qualifiers="virtual">
<return type="bool" />
<argument index="0" name="drawn_id" type="int" />
<argument index="1" name="neighbor_id" type="int" />
<description>
Determines when the auto-tiler should consider two different auto-tile IDs to be bound together.
[b]Note:[/b] [code]neighbor_id[/code] will be [code]-1[/code] ([constant TileMap.INVALID_CELL]) when checking a tile against an empty neighbor tile.
</description>
</method>
<method name="autotile_clear_bitmask_map">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
Clears all bitmask information of the autotile.
</description>
</method>
<method name="autotile_get_bitmask">
<return type="int" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<description>
Returns the bitmask of the subtile from an autotile given its coordinates.
The value is the sum of the values in [enum 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" />
<argument index="0" name="id" type="int" />
<description>
Returns the [enum BitmaskMode] of the autotile.
</description>
</method>
<method name="autotile_get_fallback_mode" qualifiers="const">
<return type="int" enum="TileSet.FallbackMode" />
<argument index="0" name="id" type="int" />
<description>
Returns the [enum FallbackMode] of the autotile.
</description>
</method>
<method name="autotile_get_icon_coordinate" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="id" type="int" />
<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 information 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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<description>
Returns the size of the subtiles in an atlas/autotile.
</description>
</method>
<method name="autotile_get_spacing" qualifiers="const">
<return type="int" />
<argument index="0" name="id" type="int" />
<description>
Returns the spacing between subtiles of the atlas/autotile.
</description>
</method>
<method name="autotile_get_subtile_priority">
<return type="int" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="bitmask" type="Vector2" />
<argument index="2" name="flag" type="int" />
<description>
Sets the bitmask of the subtile from an autotile given its coordinates.
The value is the sum of the values in [enum 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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="mode" type="int" enum="TileSet.BitmaskMode" />
<description>
Sets the [enum BitmaskMode] of the autotile.
</description>
</method>
<method name="autotile_set_fallback_mode">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="mode" type="int" enum="TileSet.FallbackMode" />
<description>
Returns the [enum FallbackMode] of the autotile.
</description>
</method>
<method name="autotile_set_icon_coordinate">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<description>
Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates.
The subtile defined as the icon may 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.
</description>
</method>
<method name="autotile_set_light_occluder">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="light_occluder" type="OccluderPolygon2D" />
<argument index="2" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="navigation_polygon" type="NavigationPolygon" />
<argument index="2" name="coord" type="Vector2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="size" type="Vector2" />
<description>
Sets the size of the subtiles in an atlas/autotile.
</description>
</method>
<method name="autotile_set_spacing">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="spacing" type="int" />
<description>
Sets the spacing between subtiles of the atlas/autotile.
</description>
</method>
<method name="autotile_set_subtile_priority">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<argument index="2" name="priority" type="int" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="coord" type="Vector2" />
<argument index="2" name="z_index" type="int" />
<description>
Sets the drawing index of the subtile from an atlas/autotile given its coordinates.
</description>
</method>
<method name="clear">
<return type="void" />
<description>
Clears all tiles.
</description>
</method>
<method name="create_tile">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
Creates a new tile with the given ID.
</description>
</method>
<method name="find_tile_by_name" qualifiers="const">
<return type="int" />
<argument index="0" name="name" type="String" />
<description>
Returns the first tile matching the given name.
</description>
</method>
<method name="get_last_unused_tile_id" qualifiers="const">
<return type="int" />
<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" />
<description>
Returns an array of all currently used tile IDs.
</description>
</method>
<method name="remove_tile">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
Removes the given tile ID.
</description>
</method>
<method name="tile_add_shape">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape" type="Shape2D" />
<argument index="2" name="shape_transform" type="Transform2D" />
<argument index="3" name="one_way" type="bool" default="false" />
<argument index="4" name="autotile_coord" type="Vector2" default="Vector2( 0, 0 )" />
<description>
Adds a shape to the tile.
</description>
</method>
<method name="tile_get_light_occluder" qualifiers="const">
<return type="OccluderPolygon2D" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's light occluder.
</description>
</method>
<method name="tile_get_material" qualifiers="const">
<return type="ShaderMaterial" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's material.
</description>
</method>
<method name="tile_get_modulate" qualifiers="const">
<return type="Color" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's modulation color.
</description>
</method>
<method name="tile_get_name" qualifiers="const">
<return type="String" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's name.
</description>
</method>
<method name="tile_get_navigation_polygon" qualifiers="const">
<return type="NavigationPolygon" />
<argument index="0" name="id" type="int" />
<description>
Returns the navigation polygon of the tile.
</description>
</method>
<method name="tile_get_navigation_polygon_offset" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="id" type="int" />
<description>
Returns the offset of the tile's navigation polygon.
</description>
</method>
<method name="tile_get_normal_map" qualifiers="const">
<return type="Texture" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's normal map texture.
</description>
</method>
<method name="tile_get_occluder_offset" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="id" type="int" />
<description>
Returns the offset of the tile's light occluder.
</description>
</method>
<method name="tile_get_region" qualifiers="const">
<return type="Rect2" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile sub-region in the texture.
</description>
</method>
<method name="tile_get_shape" qualifiers="const">
<return type="Shape2D" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<description>
Returns a tile's given shape.
</description>
</method>
<method name="tile_get_shape_count" qualifiers="const">
<return type="int" />
<argument index="0" name="id" type="int" />
<description>
Returns the number of shapes assigned to a tile.
</description>
</method>
<method name="tile_get_shape_offset" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<description>
Returns the offset of a tile's shape.
</description>
</method>
<method name="tile_get_shape_one_way" qualifiers="const">
<return type="bool" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<description>
Returns the one-way collision value of a tile's shape.
</description>
</method>
<method name="tile_get_shape_one_way_margin" qualifiers="const">
<return type="float" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<description>
</description>
</method>
<method name="tile_get_shape_transform" qualifiers="const">
<return type="Transform2D" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<description>
Returns the [Transform2D] of a tile's shape.
</description>
</method>
<method name="tile_get_shapes" qualifiers="const">
<return type="Array" />
<argument index="0" name="id" type="int" />
<description>
Returns an array of dictionaries describing the tile's shapes.
[b]Dictionary structure in the array returned by this method:[/b]
[codeblock]
{
"autotile_coord": Vector2,
"one_way": bool,
"one_way_margin": int,
"shape": CollisionShape2D,
"shape_transform": Transform2D,
}
[/codeblock]
</description>
</method>
<method name="tile_get_texture" qualifiers="const">
<return type="Texture" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's texture.
</description>
</method>
<method name="tile_get_texture_offset" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="id" type="int" />
<description>
Returns the texture offset of the tile.
</description>
</method>
<method name="tile_get_tile_mode" qualifiers="const">
<return type="int" enum="TileSet.TileMode" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's [enum TileMode].
</description>
</method>
<method name="tile_get_z_index" qualifiers="const">
<return type="int" />
<argument index="0" name="id" type="int" />
<description>
Returns the tile's Z index (drawing layer).
</description>
</method>
<method name="tile_set_light_occluder">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="light_occluder" type="OccluderPolygon2D" />
<description>
Sets a light occluder for the tile.
</description>
</method>
<method name="tile_set_material">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="material" type="ShaderMaterial" />
<description>
Sets the tile's material.
</description>
</method>
<method name="tile_set_modulate">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="color" type="Color" />
<description>
Sets the tile's modulation color.
[b]Note:[/b] Modulation is performed by setting the tile's vertex color. To access this in a shader, use [code]COLOR[/code] rather than [code]MODULATE[/code] (which instead accesses the [TileMap]'s [member CanvasItem.modulate] property).
</description>
</method>
<method name="tile_set_name">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="name" type="String" />
<description>
Sets the tile's name.
</description>
</method>
<method name="tile_set_navigation_polygon">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="navigation_polygon" type="NavigationPolygon" />
<description>
Sets the tile's navigation polygon.
</description>
</method>
<method name="tile_set_navigation_polygon_offset">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="navigation_polygon_offset" type="Vector2" />
<description>
Sets an offset for the tile's navigation polygon.
</description>
</method>
<method name="tile_set_normal_map">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="normal_map" type="Texture" />
<description>
Sets the tile's normal map texture.
[b]Note:[/b] 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_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines.
</description>
</method>
<method name="tile_set_occluder_offset">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="occluder_offset" type="Vector2" />
<description>
Sets an offset for the tile's light occluder.
</description>
</method>
<method name="tile_set_region">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="region" type="Rect2" />
<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" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<argument index="2" name="shape" type="Shape2D" />
<description>
Sets a shape for the tile, enabling collision.
</description>
</method>
<method name="tile_set_shape_offset">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<argument index="2" name="shape_offset" type="Vector2" />
<description>
Sets the offset of a tile's shape.
</description>
</method>
<method name="tile_set_shape_one_way">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<argument index="2" name="one_way" type="bool" />
<description>
Enables one-way collision on a tile's shape.
</description>
</method>
<method name="tile_set_shape_one_way_margin">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<argument index="2" name="one_way" type="float" />
<description>
</description>
</method>
<method name="tile_set_shape_transform">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shape_id" type="int" />
<argument index="2" name="shape_transform" type="Transform2D" />
<description>
Sets a [Transform2D] on a tile's shape.
</description>
</method>
<method name="tile_set_shapes">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="shapes" type="Array" />
<description>
Sets an array of shapes for the tile, enabling collision.
</description>
</method>
<method name="tile_set_texture">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="texture" type="Texture" />
<description>
Sets the tile's texture.
</description>
</method>
<method name="tile_set_texture_offset">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="texture_offset" type="Vector2" />
<description>
Sets the tile's texture offset.
</description>
</method>
<method name="tile_set_tile_mode">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="tilemode" type="int" enum="TileSet.TileMode" />
<description>
Sets the tile's [enum TileMode].
</description>
</method>
<method name="tile_set_z_index">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="z_index" type="int" />
<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="FALLBACK_AUTO" value="0" enum="FallbackMode">
Autotiles will automatically find a best match for missing tiles if they're incomplete.
</constant>
<constant name="FALLBACK_ICON" value="1" enum="FallbackMode">
Autotiles will use the icon tile for missing tiles if they're incomplete.
</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_CENTER" value="16" 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>
|