mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-14 23:35:17 +00:00
18 lines
605 B
GDScript
18 lines
605 B
GDScript
extends Node2D
|
|
|
|
|
|
func _input(event: InputEvent) -> void:
|
|
if event.is_action("ctrl"):
|
|
queue_redraw()
|
|
|
|
|
|
func _draw() -> void:
|
|
var current_cel := Global.current_project.get_current_cel()
|
|
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 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)
|