1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 09:39:48 +00:00

Some improvements to TileModeIndices

This commit is contained in:
Emmanouil Papadeas 2024-11-28 16:55:59 +02:00
parent 8ab71490cf
commit 5425275e9c

View file

@ -1,5 +1,7 @@
extends Node2D
const FONT_SIZE := 16
func _input(event: InputEvent) -> void:
if event.is_action("ctrl"):
@ -8,11 +10,15 @@ func _input(event: InputEvent) -> void:
func _draw() -> void:
var current_cel := Global.current_project.get_current_cel()
draw_set_transform(position, rotation, Vector2(0.5, 0.5))
if current_cel is CelTileMap and Input.is_action_pressed("ctrl"):
var tilemap_cel := current_cel as CelTileMap
for i in tilemap_cel.cells.size():
var tile_data := tilemap_cel.cells[i]
if tile_data.index == 0:
continue
var pos := tilemap_cel.get_cell_coords_in_image(i)
pos.y += tilemap_cel.tileset.tile_size.y
var tile_data := tilemap_cel.cells[i]
var text := tile_data.to_string()
draw_multiline_string(Themes.get_font(), pos, text, HORIZONTAL_ALIGNMENT_LEFT, -1, 10)
draw_multiline_string(Themes.get_font(), pos * 2, text, HORIZONTAL_ALIGNMENT_LEFT, -1, FONT_SIZE)
draw_set_transform(position, rotation, scale)