Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
Table of contents
-
var tile_layout = TILE_LAYOUT_STACKED -
var tile_offset_axis = TILE_OFFSET_AXIS_HORIZONTAL -
var tile_shape = TILE_SHAPE_SQUARE -
var tile_size: Vector2i = Vector2i(16, 16) -
var uv_clipping: bool = false -
func add_custom_data_layer(to_position: int = -1) -> void -
func add_navigation_layer(to_position: int = -1) -> void -
func add_occlusion_layer(to_position: int = -1) -> void -
func add_pattern(index: int = -1) -> int -
func add_physics_layer(to_position: int = -1) -> void -
func add_source(atlas_source_id_override: int = -1) -> int -
func add_terrain(to_position: int = -1) -> void -
func add_terrain_set(to_position: int = -1) -> void -
func cleanup_invalid_tile_proxies() -> void -
func clear_tile_proxies() -> void -
func get_alternative_level_tile_proxy(alternative_from: int) -> Array -
func get_coords_level_tile_proxy(coords_from: Vector2i) -> Array -
const func get_custom_data_layer_by_name(layer_name: String) -> int -
const func get_custom_data_layer_name(layer_index: int) -> String -
const func get_custom_data_layer_type(layer_index: int) -> intVariant.Type -
const func get_custom_data_layers_count() -> int -
const func get_navigation_layer_layer_value(layer_number: int) -> bool -
const func get_navigation_layer_layers(layer_index: int) -> int -
const func get_navigation_layers_count() -> int -
const func get_next_source_id() -> int -
const func get_occlusion_layer_light_mask(layer_index: int) -> int -
const func get_occlusion_layer_sdf_collision(layer_index: int) -> bool -
const func get_occlusion_layers_count() -> int -
func get_pattern(index: int = -1) -> TileMapPattern -
func get_patterns_count() -> int -
const func get_physics_layer_collision_layer(layer_index: int) -> int -
const func get_physics_layer_collision_mask(layer_index: int) -> int -
const func get_physics_layer_collision_priority(layer_index: int) -> float -
const func get_physics_layer_physics_material(layer_index: int) -> PhysicsMaterial -
const func get_physics_layers_count() -> int -
const func get_source(source_id: int) -> TileSetSource -
const func get_source_count() -> int -
const func get_source_id(index: int) -> int -
func get_source_level_tile_proxy(source_from: int) -> int -
const func get_terrain_color(terrain_index: int) -> Color -
const func get_terrain_name(terrain_index: int) -> String -
const func get_terrain_set_mode(terrain_set: int) -> intTileSet.TerrainMode -
const func get_terrain_sets_count() -> int -
const func get_terrains_count(terrain_set: int) -> int -
func has_alternative_level_tile_proxy(alternative_from: int) -> bool -
func has_coords_level_tile_proxy(coords_from: Vector2i) -> bool -
const func has_custom_data_layer_by_name(layer_name: String) -> bool -
const func has_source(source_id: int) -> bool -
func has_source_level_tile_proxy(source_from: int) -> bool -
const func map_tile_proxy(alternative_from: int) -> Array -
func move_custom_data_layer(to_position: int) -> void -
func move_navigation_layer(to_position: int) -> void -
func move_occlusion_layer(to_position: int) -> void -
func move_physics_layer(to_position: int) -> void -
func move_terrain(to_position: int) -> void -
func move_terrain_set(to_position: int) -> void -
func remove_alternative_level_tile_proxy(alternative_from: int) -> void -
func remove_coords_level_tile_proxy(coords_from: Vector2i) -> void -
func remove_custom_data_layer(layer_index: int) -> void -
func remove_navigation_layer(layer_index: int) -> void -
func remove_occlusion_layer(layer_index: int) -> void -
func remove_pattern(index: int) -> void -
func remove_physics_layer(layer_index: int) -> void -
func remove_source(source_id: int) -> void -
func remove_source_level_tile_proxy(source_from: int) -> void -
func remove_terrain(terrain_index: int) -> void -
func remove_terrain_set(terrain_set: int) -> void -
func set_alternative_level_tile_proxy(alternative_to: int) -> void -
func set_coords_level_tile_proxy(coords_to: Vector2i) -> void -
func set_custom_data_layer_name(layer_name: String) -> void -
func set_custom_data_layer_type(layer_type: int enumVariant.Type) -> void -
func set_navigation_layer_layer_value(value: bool) -> void -
func set_navigation_layer_layers(layers: int) -> void -
func set_occlusion_layer_light_mask(light_mask: int) -> void -
func set_occlusion_layer_sdf_collision(sdf_collision: bool) -> void -
func set_physics_layer_collision_layer(layer: int) -> void -
func set_physics_layer_collision_mask(mask: int) -> void -
func set_physics_layer_collision_priority(priority: float) -> void -
func set_physics_layer_physics_material(physics_material: PhysicsMaterial) -> void -
func set_source_id(new_source_id: int) -> void -
func set_source_level_tile_proxy(source_to: int) -> void -
func set_terrain_color(color: Color) -> void -
func set_terrain_name(name: String) -> void -
func set_terrain_set_mode(mode: int enumTileSet.TerrainMode) -> void -
const TILE_SHAPE_SQUARE = 0 enum TileShape -
const TILE_SHAPE_ISOMETRIC = 1 enum TileShape -
const TILE_SHAPE_HALF_OFFSET_SQUARE = 2 enum TileShape -
const TILE_SHAPE_HEXAGON = 3 enum TileShape -
const TILE_LAYOUT_STACKED = 0 enum TileLayout -
const TILE_LAYOUT_STACKED_OFFSET = 1 enum TileLayout -
const TILE_LAYOUT_STAIRS_RIGHT = 2 enum TileLayout -
const TILE_LAYOUT_STAIRS_DOWN = 3 enum TileLayout -
const TILE_LAYOUT_DIAMOND_RIGHT = 4 enum TileLayout -
const TILE_LAYOUT_DIAMOND_DOWN = 5 enum TileLayout -
const TILE_OFFSET_AXIS_HORIZONTAL = 0 enum TileOffsetAxis -
const TILE_OFFSET_AXIS_VERTICAL = 1 enum TileOffsetAxis -
const CELL_NEIGHBOR_RIGHT_SIDE = 0 enum CellNeighbor -
const CELL_NEIGHBOR_RIGHT_CORNER = 1 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE = 2 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER = 3 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_SIDE = 4 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_CORNER = 5 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_LEFT_SIDE = 6 enum CellNeighbor -
const CELL_NEIGHBOR_BOTTOM_LEFT_CORNER = 7 enum CellNeighbor -
const CELL_NEIGHBOR_LEFT_SIDE = 8 enum CellNeighbor -
const CELL_NEIGHBOR_LEFT_CORNER = 9 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_LEFT_SIDE = 10 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_LEFT_CORNER = 11 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_SIDE = 12 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_CORNER = 13 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_RIGHT_SIDE = 14 enum CellNeighbor -
const CELL_NEIGHBOR_TOP_RIGHT_CORNER = 15 enum CellNeighbor -
const TERRAIN_MODE_MATCH_CORNERS_AND_SIDES = 0 enum TerrainMode -
const TERRAIN_MODE_MATCH_CORNERS = 1 enum TerrainMode -
const TERRAIN_MODE_MATCH_SIDES = 2 enum TerrainMode -
enum TileShape -
enum TileLayout -
enum TileOffsetAxis -
enum CellNeighbor -
enum TerrainMode
TileSet #
is_refcounted, is_instantiable, resource, core, not_builtin_classes
Tile library for tilemaps.
A TileSet is a library of tiles for a TileMapLayer. A TileSet handles a list of TileSetSource, each of them storing a set of tiles.
Tiles can either be from a TileSetAtlasSource, which renders tiles out of a texture with support for physics, navigation, etc., or from a TileSetScenesCollectionSource, which exposes scene-based tiles.
Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID, and their alternative tile ID.
A TileSet can be configured so that its tiles expose more or fewer properties. To do so, the TileSet resources use property layers, which you can add or remove depending on your needs.
For example, adding a physics layer allows giving collision shapes to your tiles. Each layer has dedicated properties (physics layer and mask), so you may add several TileSet physics layers for each type of collision you need.
See the functions to add new layers for more information.
Members #
var tile_layout = TILE_LAYOUT_STACKED#
For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles are indexed in the TileMap grid.
var tile_offset_axis = TILE_OFFSET_AXIS_HORIZONTAL#
For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset axis.
var tile_shape = TILE_SHAPE_SQUARE#
The tile shape.
var tile_size: Vector2i = Vector2i(16, 16)#
The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas.
var uv_clipping: bool = false#
Enables/Disable uv clipping when rendering the tiles.
Methods #
func add_custom_data_layer(to_position: int = -1) -> void#
Adds a custom data layer to the TileSet at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
Custom data layers allow assigning custom properties to atlas tiles.
func add_navigation_layer(to_position: int = -1) -> void#
Adds a navigation layer to the TileSet at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
Navigation layers allow assigning a navigable area to atlas tiles.
func add_occlusion_layer(to_position: int = -1) -> void#
Adds an occlusion layer to the TileSet at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
Occlusion layers allow assigning occlusion polygons to atlas tiles.
func add_pattern(index: int = -1) -> int#
Adds a TileMapPattern to be stored in the TileSet resource. If provided, insert it at the given index.
func add_physics_layer(to_position: int = -1) -> void#
Adds a physics layer to the TileSet at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
Physics layers allow assigning collision polygons to atlas tiles.
func add_source(atlas_source_id_override: int = -1) -> int#
Adds a TileSetSource to the TileSet. If atlas_source_id_override is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated.
The function returns the added source ID or -1 if the source could not be added.
Warning: A source cannot belong to two TileSets at the same time. If the added source was attached to another TileSet, it will be removed from that one.
func add_terrain(to_position: int = -1) -> void#
Adds a new terrain to the given terrain set terrain_set at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
func add_terrain_set(to_position: int = -1) -> void#
Adds a new terrain set at the given position to_position in the array. If to_position is -1, adds it at the end of the array.
func cleanup_invalid_tile_proxies() -> void#
Clears tile proxies pointing to invalid tiles.
func clear_tile_proxies() -> void#
Clears all tile proxies.
func get_alternative_level_tile_proxy(alternative_from: int) -> Array#
Returns the alternative-level proxy for the given identifiers. The returned array contains the three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID).
If the TileSet has no proxy for the given identifiers, returns an empty Array.
func get_coords_level_tile_proxy(coords_from: Vector2i) -> Array#
Returns the coordinate-level proxy for the given identifiers. The returned array contains the two target identifiers of the proxy (source ID and atlas coordinates ID).
If the TileSet has no proxy for the given identifiers, returns an empty Array.
const func get_custom_data_layer_by_name(layer_name: String) -> int#
Returns the index of the custom data layer identified by the given name.
const func get_custom_data_layer_name(layer_index: int) -> String#
Returns the name of the custom data layer identified by the given index.
const func get_custom_data_layer_type(layer_index: int) -> intVariant.Type#
Returns the type of the custom data layer identified by the given index.
const func get_custom_data_layers_count() -> int#
Returns the custom data layers count.
const func get_navigation_layer_layer_value(layer_number: int) -> bool#
Returns whether or not the specified navigation layer of the TileSet navigation data layer identified by the given layer_index is enabled, given a navigation_layers layer_number between 1 and 32.
const func get_navigation_layer_layers(layer_index: int) -> int#
Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer.
const func get_navigation_layers_count() -> int#
Returns the navigation layers count.
const func get_next_source_id() -> int#
Returns a new unused source ID. This generated ID is the same that a call to add_source would return.
const func get_occlusion_layer_light_mask(layer_index: int) -> int#
Returns the light mask of the occlusion layer.
const func get_occlusion_layer_sdf_collision(layer_index: int) -> bool#
Returns if the occluders from this layer use sdf_collision.
const func get_occlusion_layers_count() -> int#
Returns the occlusion layers count.
func get_pattern(index: int = -1) -> TileMapPattern#
Returns the TileMapPattern at the given index.
func get_patterns_count() -> int#
Returns the number of TileMapPattern this tile set handles.
const func get_physics_layer_collision_layer(layer_index: int) -> int#
Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in.
const func get_physics_layer_collision_mask(layer_index: int) -> int#
Returns the collision mask of bodies on the given TileSet's physics layer.
const func get_physics_layer_collision_priority(layer_index: int) -> float#
Returns the collision priority of bodies on the given TileSet's physics layer.
const func get_physics_layer_physics_material(layer_index: int) -> PhysicsMaterial#
Returns the physics material of bodies on the given TileSet's physics layer.
const func get_physics_layers_count() -> int#
Returns the physics layers count.
const func get_source(source_id: int) -> TileSetSource#
Returns the TileSetSource with ID source_id.
const func get_source_count() -> int#
Returns the number of TileSetSource in this TileSet.
const func get_source_id(index: int) -> int#
Returns the source ID for source with index index.
func get_source_level_tile_proxy(source_from: int) -> int#
Returns the source-level proxy for the given source identifier.
If the TileSet has no proxy for the given identifier, returns -1.
const func get_terrain_color(terrain_index: int) -> Color#
Returns a terrain's color.
const func get_terrain_name(terrain_index: int) -> String#
Returns a terrain's name.
const func get_terrain_set_mode(terrain_set: int) -> intTileSet.TerrainMode#
Returns a terrain set mode.
const func get_terrain_sets_count() -> int#
Returns the terrain sets count.
const func get_terrains_count(terrain_set: int) -> int#
Returns the number of terrains in the given terrain set.
func has_alternative_level_tile_proxy(alternative_from: int) -> bool#
Returns if there is an alternative-level proxy for the given identifiers.
func has_coords_level_tile_proxy(coords_from: Vector2i) -> bool#
Returns if there is a coodinates-level proxy for the given identifiers.
const func has_custom_data_layer_by_name(layer_name: String) -> bool#
Returns if there is a custom data layer named layer_name.
const func has_source(source_id: int) -> bool#
Returns if this TileSet has a source for the given source ID.
func has_source_level_tile_proxy(source_from: int) -> bool#
Returns if there is a source-level proxy for the given source ID.
const func map_tile_proxy(alternative_from: int) -> Array#
According to the configured proxies, maps the provided identifiers to a new set of identifiers. The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array.
This function first look for matching alternative-level proxies, then coordinates-level proxies, then source-level proxies.
If no proxy corresponding to provided identifiers are found, returns the same values the ones used as arguments.
func move_custom_data_layer(to_position: int) -> void#
Moves the custom data layer at index layer_index to the given position to_position in the array. Also updates the atlas tiles accordingly.
func move_navigation_layer(to_position: int) -> void#
Moves the navigation layer at index layer_index to the given position to_position in the array. Also updates the atlas tiles accordingly.
func move_occlusion_layer(to_position: int) -> void#
Moves the occlusion layer at index layer_index to the given position to_position in the array. Also updates the atlas tiles accordingly.
func move_physics_layer(to_position: int) -> void#
Moves the physics layer at index layer_index to the given position to_position in the array. Also updates the atlas tiles accordingly.
func move_terrain(to_position: int) -> void#
Moves the terrain at index terrain_index for terrain set terrain_set to the given position to_position in the array. Also updates the atlas tiles accordingly.
func move_terrain_set(to_position: int) -> void#
Moves the terrain set at index terrain_set to the given position to_position in the array. Also updates the atlas tiles accordingly.
func remove_alternative_level_tile_proxy(alternative_from: int) -> void#
Removes an alternative-level proxy for the given identifiers.
func remove_coords_level_tile_proxy(coords_from: Vector2i) -> void#
Removes a coordinates-level proxy for the given identifiers.
func remove_custom_data_layer(layer_index: int) -> void#
Removes the custom data layer at index layer_index. Also updates the atlas tiles accordingly.
func remove_navigation_layer(layer_index: int) -> void#
Removes the navigation layer at index layer_index. Also updates the atlas tiles accordingly.
func remove_occlusion_layer(layer_index: int) -> void#
Removes the occlusion layer at index layer_index. Also updates the atlas tiles accordingly.
func remove_pattern(index: int) -> void#
Remove the TileMapPattern at the given index.
func remove_physics_layer(layer_index: int) -> void#
Removes the physics layer at index layer_index. Also updates the atlas tiles accordingly.
func remove_source(source_id: int) -> void#
Removes the source with the given source ID.
func remove_source_level_tile_proxy(source_from: int) -> void#
Removes a source-level tile proxy.
func remove_terrain(terrain_index: int) -> void#
Removes the terrain at index terrain_index in the given terrain set terrain_set. Also updates the atlas tiles accordingly.
func remove_terrain_set(terrain_set: int) -> void#
Removes the terrain set at index terrain_set. Also updates the atlas tiles accordingly.
func set_alternative_level_tile_proxy(alternative_to: int) -> void#
Create an alternative-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers.
This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
Proxied tiles can be automatically replaced in TileMap nodes using the editor.
func set_coords_level_tile_proxy(coords_to: Vector2i) -> void#
Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. The alternative tile ID is kept the same when using coordinates-level proxies.
This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
Proxied tiles can be automatically replaced in TileMap nodes using the editor.
func set_custom_data_layer_name(layer_name: String) -> void#
Sets the name of the custom data layer identified by the given index. Names are identifiers of the layer therefore if the name is already taken it will fail and raise an error.
func set_custom_data_layer_type(layer_type: int enumVariant.Type) -> void#
Sets the type of the custom data layer identified by the given index.
func set_navigation_layer_layer_value(value: bool) -> void#
Based on value, enables or disables the specified navigation layer of the TileSet navigation data layer identified by the given layer_index, given a navigation_layers layer_number between 1 and 32.
func set_navigation_layer_layers(layers: int) -> void#
Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer.
func set_occlusion_layer_light_mask(light_mask: int) -> void#
Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer.
func set_occlusion_layer_sdf_collision(sdf_collision: bool) -> void#
Enables or disables SDF collision for occluders in the given TileSet occlusion layer.
func set_physics_layer_collision_layer(layer: int) -> void#
Sets the collision layer (as in the physics server) for bodies in the given TileSet physics layer.
func set_physics_layer_collision_mask(mask: int) -> void#
Sets the collision mask for bodies in the given TileSet physics layer.
func set_physics_layer_collision_priority(priority: float) -> void#
Sets the collision priority for bodies in the given TileSet physics layer.
func set_physics_layer_physics_material(physics_material: PhysicsMaterial) -> void#
Sets the physics material for bodies in the given TileSet physics layer.
func set_source_id(new_source_id: int) -> void#
Changes a source's ID.
func set_source_level_tile_proxy(source_to: int) -> void#
Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlas coordinates ID and the alternative tile ID are kept the same when using source-level proxies.
This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available.
Proxied tiles can be automatically replaced in TileMap nodes using the editor.
func set_terrain_color(color: Color) -> void#
Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor.
func set_terrain_name(name: String) -> void#
Sets a terrain's name.
func set_terrain_set_mode(mode: int enumTileSet.TerrainMode) -> void#
Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighboring tiles' terrains.
Annotations #
Constants #
const TILE_SHAPE_SQUARE = 0 enum TileShape#
Rectangular tile shape.
const TILE_SHAPE_ISOMETRIC = 1 enum TileShape#
Diamond tile shape (for isometric look).
Note: Isometric TileSet works best if TileMap and all its layers have Y-sort enabled.
const TILE_SHAPE_HALF_OFFSET_SQUARE = 2 enum TileShape#
Rectangular tile shape with one row/column out of two offset by half a tile.
const TILE_SHAPE_HEXAGON = 3 enum TileShape#
Hexagonal tile shape.
const TILE_LAYOUT_STACKED = 0 enum TileLayout#
Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis.
const TILE_LAYOUT_STACKED_OFFSET = 1 enum TileLayout#
Same as TILE_LAYOUT_STACKED, but the first half-offset is negative instead of positive.
const TILE_LAYOUT_STAIRS_RIGHT = 2 enum TileLayout#
Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right.
const TILE_LAYOUT_STAIRS_DOWN = 3 enum TileLayout#
Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes down-right.
const TILE_LAYOUT_DIAMOND_RIGHT = 4 enum TileLayout#
Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right.
const TILE_LAYOUT_DIAMOND_DOWN = 5 enum TileLayout#
Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left.
const TILE_OFFSET_AXIS_HORIZONTAL = 0 enum TileOffsetAxis#
Horizontal half-offset.
const TILE_OFFSET_AXIS_VERTICAL = 1 enum TileOffsetAxis#
Vertical half-offset.
const CELL_NEIGHBOR_RIGHT_SIDE = 0 enum CellNeighbor#
Neighbor on the right side.
const CELL_NEIGHBOR_RIGHT_CORNER = 1 enum CellNeighbor#
Neighbor in the right corner.
const CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE = 2 enum CellNeighbor#
Neighbor on the bottom right side.
const CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER = 3 enum CellNeighbor#
Neighbor in the bottom right corner.
const CELL_NEIGHBOR_BOTTOM_SIDE = 4 enum CellNeighbor#
Neighbor on the bottom side.
const CELL_NEIGHBOR_BOTTOM_CORNER = 5 enum CellNeighbor#
Neighbor in the bottom corner.
const CELL_NEIGHBOR_BOTTOM_LEFT_SIDE = 6 enum CellNeighbor#
Neighbor on the bottom left side.
const CELL_NEIGHBOR_BOTTOM_LEFT_CORNER = 7 enum CellNeighbor#
Neighbor in the bottom left corner.
const CELL_NEIGHBOR_LEFT_SIDE = 8 enum CellNeighbor#
Neighbor on the left side.
const CELL_NEIGHBOR_LEFT_CORNER = 9 enum CellNeighbor#
Neighbor in the left corner.
const CELL_NEIGHBOR_TOP_LEFT_SIDE = 10 enum CellNeighbor#
Neighbor on the top left side.
const CELL_NEIGHBOR_TOP_LEFT_CORNER = 11 enum CellNeighbor#
Neighbor in the top left corner.
const CELL_NEIGHBOR_TOP_SIDE = 12 enum CellNeighbor#
Neighbor on the top side.
const CELL_NEIGHBOR_TOP_CORNER = 13 enum CellNeighbor#
Neighbor in the top corner.
const CELL_NEIGHBOR_TOP_RIGHT_SIDE = 14 enum CellNeighbor#
Neighbor on the top right side.
const CELL_NEIGHBOR_TOP_RIGHT_CORNER = 15 enum CellNeighbor#
Neighbor in the top right corner.
const TERRAIN_MODE_MATCH_CORNERS_AND_SIDES = 0 enum TerrainMode#
Requires both corners and side to match with neighboring tiles' terrains.
const TERRAIN_MODE_MATCH_CORNERS = 1 enum TerrainMode#
Requires corners to match with neighboring tiles' terrains.
const TERRAIN_MODE_MATCH_SIDES = 2 enum TerrainMode#
Requires sides to match with neighboring tiles' terrains.
Constructors #
Enums #
TileShape#
enum TileShape {
TILE_SHAPE_SQUARE = 0,
TILE_SHAPE_ISOMETRIC = 1,
TILE_SHAPE_HALF_OFFSET_SQUARE = 2,
TILE_SHAPE_HEXAGON = 3,
}TileLayout#
enum TileLayout {
TILE_LAYOUT_STACKED = 0,
TILE_LAYOUT_STACKED_OFFSET = 1,
TILE_LAYOUT_STAIRS_RIGHT = 2,
TILE_LAYOUT_STAIRS_DOWN = 3,
TILE_LAYOUT_DIAMOND_RIGHT = 4,
TILE_LAYOUT_DIAMOND_DOWN = 5,
}TileOffsetAxis#
enum TileOffsetAxis {
TILE_OFFSET_AXIS_HORIZONTAL = 0,
TILE_OFFSET_AXIS_VERTICAL = 1,
}CellNeighbor#
enum CellNeighbor {
CELL_NEIGHBOR_RIGHT_SIDE = 0,
CELL_NEIGHBOR_RIGHT_CORNER = 1,
CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE = 2,
CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER = 3,
CELL_NEIGHBOR_BOTTOM_SIDE = 4,
CELL_NEIGHBOR_BOTTOM_CORNER = 5,
CELL_NEIGHBOR_BOTTOM_LEFT_SIDE = 6,
CELL_NEIGHBOR_BOTTOM_LEFT_CORNER = 7,
CELL_NEIGHBOR_LEFT_SIDE = 8,
CELL_NEIGHBOR_LEFT_CORNER = 9,
CELL_NEIGHBOR_TOP_LEFT_SIDE = 10,
CELL_NEIGHBOR_TOP_LEFT_CORNER = 11,
CELL_NEIGHBOR_TOP_SIDE = 12,
CELL_NEIGHBOR_TOP_CORNER = 13,
CELL_NEIGHBOR_TOP_RIGHT_SIDE = 14,
CELL_NEIGHBOR_TOP_RIGHT_CORNER = 15,
}TerrainMode#
enum TerrainMode {
TERRAIN_MODE_MATCH_CORNERS_AND_SIDES = 0,
TERRAIN_MODE_MATCH_CORNERS = 1,
TERRAIN_MODE_MATCH_SIDES = 2,
}