2024-11-22 02:08:17 +02:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
|
|
|
func _input(event: InputEvent) -> void:
|
2024-11-23 01:51:26 +02:00
|
|
|
if event.is_action("ctrl"):
|
|
|
|
queue_redraw()
|
2024-11-22 02:08:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
func _draw() -> void:
|
|
|
|
var current_cel := Global.current_project.get_current_cel()
|
2024-11-23 01:51:26 +02:00
|
|
|
if current_cel is CelTileMap and Input.is_action_pressed("ctrl"):
|
2024-11-22 02:08:17 +02:00
|
|
|
var tilemap_cel := current_cel as CelTileMap
|
|
|
|
for i in tilemap_cel.indices.size():
|
|
|
|
var x := float(tilemap_cel.tileset.tile_size.x) * (i % tilemap_cel.indices_x)
|
|
|
|
var y := float(tilemap_cel.tileset.tile_size.y) * (i / tilemap_cel.indices_x)
|
|
|
|
var pos := Vector2i(x, y + tilemap_cel.tileset.tile_size.y)
|
|
|
|
draw_string(Themes.get_font(), pos, str(tilemap_cel.indices[i]), 0, -1, 12)
|