diff --git a/src/Autoload/Tools.gd b/src/Autoload/Tools.gd index 17d062e50..8b5cb0837 100644 --- a/src/Autoload/Tools.gd +++ b/src/Autoload/Tools.gd @@ -217,7 +217,7 @@ Hold %s to displace the shape's origin""", "Text", "text", "res://src/Tools/UtilityTools/Text.tscn", - [Global.LayerTypes.PIXEL], + [Global.LayerTypes.PIXEL, Global.LayerTypes.TILEMAP], "" ), "3DShapeEdit": diff --git a/src/Classes/Cels/CelTileMap.gd b/src/Classes/Cels/CelTileMap.gd index 83e3737aa..375e962bf 100644 --- a/src/Classes/Cels/CelTileMap.gd +++ b/src/Classes/Cels/CelTileMap.gd @@ -10,7 +10,7 @@ var indices_x: int var indices_y: int -func _init(_tileset: TileSetCustom, _image := Image.new(), _opacity := 1.0) -> void: +func _init(_tileset: TileSetCustom, _image: ImageExtended, _opacity := 1.0) -> void: super._init(_image, _opacity) tileset = _tileset indices_x = ceili(float(get_image().get_width()) / tileset.tile_size.x) diff --git a/src/Classes/Layers/LayerTileMap.gd b/src/Classes/Layers/LayerTileMap.gd index f48ed651e..c6a2296cc 100644 --- a/src/Classes/Layers/LayerTileMap.gd +++ b/src/Classes/Layers/LayerTileMap.gd @@ -17,5 +17,9 @@ func get_layer_type() -> int: func new_empty_cel() -> BaseCel: - var image := Image.create(project.size.x, project.size.y, false, Image.FORMAT_RGBA8) + var format := project.get_image_format() + var is_indexed := project.is_indexed() + var image := ImageExtended.create_custom( + project.size.x, project.size.y, false, format, is_indexed + ) return CelTileMap.new(tileset, image)