TileSet

Inherits: Resource < Reference < Object

类别: 核心

简要说明

tilemaps的平铺库。

方法

Vector2

_forward_atlas_subtile_selection ( int atlastile_id, Object tilemap, Vector2 tile_location ) virtual

Vector2

_forward_subtile_selection ( int autotile_id, int bitmask, Object tilemap, Vector2 tile_location ) virtual

bool

_is_tile_bound ( int drawn_id, int neighbor_id ) virtual

无效

autotile_clear_bitmask_map ( int id )

int

autotile_get_bitmask ( int id, Vector2 coord )

BitmaskMode

autotile_get_bitmask_mode ( int id ) const

Vector2

autotile_get_icon_coordinate ( int id ) const

OccluderPolygon2D

autotile_get_light_occluder ( int id, Vector2 coord ) const

NavigationPolygon

autotile_get_navigation_polygon ( int id, Vector2 coord ) const

Vector2

autotile_get_size ( int id ) const

int

autotile_get_spacing ( int id ) const

int

autotile_get_subtile_priority ( int id, Vector2 coord )

int

autotile_get_z_index ( int id, Vector2 coord )

无效

autotile_set_bitmask ( int id, Vector2 bitmask, int flag )

无效

autotile_set_bitmask_mode ( int id, BitmaskMode mode )

无效

autotile_set_icon_coordinate ( int id, Vector2 coord )

无效

autotile_set_light_occluder ( int id, OccluderPolygon2D light_occluder, Vector2 coord )

无效

autotile_set_navigation_polygon ( int id, NavigationPolygon navigation_polygon, Vector2 coord )

无效

autotile_set_size ( int id, Vector2 size )

无效

autotile_set_spacing ( int id, int spacing )

无效

autotile_set_subtile_priority ( int id, Vector2 coord, int priority )

无效

autotile_set_z_index ( int id, Vector2 coord, int z_index )

无效

clear ( )

无效

create_tile ( int id )

int

find_tile_by_name ( String name ) const

int

get_last_unused_tile_id ( ) const

Array

get_tiles_ids ( ) const

无效

remove_tile ( int id )

无效

tile_add_shape ( int id, Shape2D shape, Transform2D shape_transform, bool one_way=false, Vector2 autotile_coord=Vector2( 0, 0 ) )

OccluderPolygon2D

tile_get_light_occluder ( int id ) const

ShaderMaterial

tile_get_material ( int id ) const

Color

tile_get_modulate ( int id ) const

String

tile_get_name ( int id ) const

NavigationPolygon

tile_get_navigation_polygon ( int id ) const

Vector2

tile_get_navigation_polygon_offset ( int id ) const

Texture

tile_get_normal_map ( int id ) const

Vector2

tile_get_occluder_offset ( int id ) const

Rect2

tile_get_region ( int id ) const

Shape2D

tile_get_shape ( int id, int shape_id ) const

int

tile_get_shape_count ( int id ) const

Vector2

tile_get_shape_offset ( int id, int shape_id ) const

bool

tile_get_shape_one_way ( int id, int shape_id ) const

float

tile_get_shape_one_way_margin ( int id, int shape_id ) const

Transform2D

tile_get_shape_transform ( int id, int shape_id ) const

Array

tile_get_shapes ( int id ) const

Texture

tile_get_texture ( int id ) const

Vector2

tile_get_texture_offset ( int id ) const

TileMode

tile_get_tile_mode ( int id ) const

int

tile_get_z_index ( int id ) const

无效

tile_set_light_occluder ( int id, OccluderPolygon2D light_occluder )

无效

tile_set_material ( int id, ShaderMaterial material )

无效

tile_set_modulate ( int id, Color color )

无效

tile_set_name ( int id, String name )

无效

tile_set_navigation_polygon ( int id, NavigationPolygon navigation_polygon )

无效

tile_set_navigation_polygon_offset ( int id, Vector2 navigation_polygon_offset )

无效

tile_set_normal_map ( int id, Texture normal_map )

无效

tile_set_occluder_offset ( int id, Vector2 occluder_offset )

无效

tile_set_region ( int id, Rect2 region )

无效

tile_set_shape ( int id, int shape_id, Shape2D shape )

无效

tile_set_shape_offset ( int id, int shape_id, Vector2 shape_offset )

无效

tile_set_shape_one_way ( int id, int shape_id, bool one_way )

无效

tile_set_shape_one_way_margin ( int id, int shape_id, float one_way )

无效

tile_set_shape_transform ( int id, int shape_id, Transform2D shape_transform )

无效

tile_set_shapes ( int id, Array shapes )

无效

tile_set_texture ( int id, Texture texture )

无效

tile_set_texture_offset ( int id, Vector2 texture_offset )

无效

tile_set_tile_mode ( int id, TileMode tilemode )

无效

tile_set_z_index ( int id, int z_index )

枚举

枚举 BitmaskMode

  • BITMASK_2X2 = 0

  • BITMASK_3X3_MINIMAL = 1

  • BITMASK_3X3 = 2

枚举 AutotileBindings

  • BIND_TOPLEFT = 1

  • BIND_TOP = 2

  • BIND_TOPRIGHT = 4

  • BIND_LEFT = 8

  • BIND_RIGHT = 32

  • BIND_BOTTOMLEFT = 64

  • BIND_BOTTOM = 128

  • BIND_BOTTOMRIGHT = 256

枚举 TileMode

  • SINGLE_TILE = 0

  • AUTO_TILE = 1

  • ATLAS_TILE = 2

描述

Tileset是一个为 TileMap . 它包含一个瓷砖列表,每个瓷砖由一个精灵和可选的碰撞形状组成。

瓷砖由唯一的整数ID引用。

方法说明

  • bool _is_tile_bound ( int drawn_id, int neighbor_id ) virtual

  • void autotile_clear_bitmask_map ( int id )

清除自动文件的所有位掩码信息。

返回给定坐标的自动文件中的字幕位掩码。

值是中的值之和 AutotileBindings 出现在副标题中(例如,值为5表示位掩码在左上和右上都有绑定)。

返回 BitmaskMode 自动档的。

  • Vector2 autotile_get_icon_coordinate ( int id ) const

返回在给定坐标的Atlas/Autofile中用作图标的副标题。

定义为图标的副标题将在Atlas/AutoFile的位掩码信息不完整时用作回退。它还将用于在tileset编辑器中表示它。

返回给定坐标的Atlas/Autofile中的字幕遮光罩。

返回给定坐标的地图集/自动图档中副标题的导航多边形。

返回Atlas/Autofile中副标题的大小。

  • int autotile_get_spacing ( int id ) const

返回Atlas/自动图档副标题之间的间距。

返回给定坐标的自动文件中的子标题的优先级。

当多个字幕具有相同的位掩码值时,将随机选取其中一个字幕进行绘制。它的优先级将定义它被选取的频率。

返回给定坐标的Atlas/Auto文件中副标题的绘图索引。

  • void autotile_set_bitmask ( int id, Vector2 bitmask, int flag )

在给定坐标的情况下,从自动文件设置字幕的位掩码。

值是中的值之和 AutotileBindings 出现在副标题中(例如,值为5表示位掩码在左上和右上都有绑定)。

设置 BitmaskMode 自动档的。

  • void autotile_set_icon_coordinate ( int id, Vector2 coord )

在给定坐标的情况下,设置将用作地图集/自动图档中图标的副标题。

定义为图标的副标题将在Atlas/AutoFile的位掩码信息不完整时用作回退。它还将用于在tileset编辑器中表示它。

根据地图集/自动图档的坐标设置字幕的遮光罩。

根据地图集/自动图档的坐标设置字幕的导航多边形。

设置地图集/自动图档中字幕的大小。

  • void autotile_set_spacing ( int id, int spacing )

设置图集/自动图档的副标题之间的间距。

  • void autotile_set_subtile_priority ( int id, Vector2 coord, int priority )

根据自动图文件的坐标设置子文件的优先级。

当多个字幕具有相同的位掩码值时,将随机选取其中一个字幕进行绘制。它的优先级将定义它被选取的频率。

  • void autotile_set_z_index ( int id, Vector2 coord, int z_index )

根据地图集/自动图档的坐标设置副标题的绘图索引。

  • void clear ( )

清除所有瓷砖。

  • void create_tile ( int id )

创建具有给定ID的新磁贴。

  • int find_tile_by_name ( String name ) const

返回与给定名称匹配的第一个磁贴。

  • int get_last_unused_tile_id ( ) const

返回最后一个当前使用的ID之后的ID,在创建新的磁贴时很有用。

  • Array get_tiles_ids ( ) const

返回当前使用的所有磁贴ID的数组。

  • void remove_tile ( int id )

删除给定的磁贴ID。

向平铺添加形状。

返回瓷砖的灯光遮挡器。

返回瓷砖的材质。

  • Color tile_get_modulate ( int id ) const

返回磁贴的调制颜色。

返回磁贴的名称。

返回图块的导航多边形。

  • Vector2 tile_get_navigation_polygon_offset ( int id ) const

返回平铺导航多边形的偏移量。

返回图块的正常贴图纹理。

  • Vector2 tile_get_occluder_offset ( int id ) const

返回平铺的灯光遮挡器的偏移量。

  • Rect2 tile_get_region ( int id ) const

返回纹理中的平铺子区域。

返回图块的给定形状。

  • int tile_get_shape_count ( int id ) const

返回分配给图块的形状数。

返回平铺形状的偏移量。

  • bool tile_get_shape_one_way ( int id, int shape_id ) const

返回平铺形状的单向碰撞值。

  • float tile_get_shape_one_way_margin ( int id, int shape_id ) const

返回 Transform2D 瓷砖的形状。

  • Array tile_get_shapes ( int id ) const

返回平铺形状的数组。

返回瓷砖的纹理。

  • Vector2 tile_get_texture_offset ( int id ) const

返回瓷砖的纹理偏移量。

返回磁贴 TileMode .

  • int tile_get_z_index ( int id ) const

返回图块的Z索引(绘图层)。

为瓷砖设置灯光遮挡器。

设置瓷砖的材质。

  • void tile_set_modulate ( int id, Color color )

设置磁贴的调制颜色。

设置磁贴的名称。

设置平铺的导航多边形。

  • void tile_set_navigation_polygon_offset ( int id, Vector2 navigation_polygon_offset )

设置平铺导航多边形的偏移。

  • void tile_set_normal_map ( int id, Texture normal_map )

设置图块的正常贴图纹理。

  • void tile_set_occluder_offset ( int id, Vector2 occluder_offset )

设置瓷砖的灯光遮挡器的偏移。

  • void tile_set_region ( int id, Rect2 region )

设置纹理中瓷砖的子区域。这在纹理图集中很常见。

设置瓷砖的形状,启用碰撞。

  • void tile_set_shape_offset ( int id, int shape_id, Vector2 shape_offset )

设置平铺形状的偏移量。

  • void tile_set_shape_one_way ( int id, int shape_id, bool one_way )

在平铺形状上启用单向碰撞。

  • void tile_set_shape_one_way_margin ( int id, int shape_id, float one_way )

  • void tile_set_shape_transform ( int id, int shape_id, Transform2D shape_transform )

设置一个 Transform2D 在瓷砖的形状上。

  • void tile_set_shapes ( int id, Array shapes )

设置瓷砖的形状数组,启用碰撞。

  • void tile_set_texture ( int id, Texture texture )

设置瓷砖的纹理。

  • void tile_set_texture_offset ( int id, Vector2 texture_offset )

设置瓷砖的纹理偏移。

  • void tile_set_tile_mode ( int id, TileMode tilemode )

设置瓷砖的 TileMode .

  • void tile_set_z_index ( int id, int z_index )

设置图块的绘图索引。