Files
MaidEngine/scripts/tile_highlight.gd
2026-04-02 23:02:18 -04:00

28 lines
557 B
GDScript

extends ColorRect
@export var tile_size: float = 48.0
var _time: float = 0.0
func _ready() -> void:
size = Vector2(tile_size, tile_size)
color = Color(1.0, 1.0, 1.0, 0.25)
mouse_filter = Control.MOUSE_FILTER_IGNORE
func _process(delta: float) -> void:
_time += delta
color.a = 0.25 + 0.1 * sin(_time * 4.0)
func set_grid_coords(coords: Vector2i) -> void:
global_position = Vector2(coords) * tile_size
func _notification(what: int) -> void:
if what == NOTIFICATION_WM_MOUSE_EXIT:
hide()
elif what == NOTIFICATION_WM_MOUSE_ENTER:
show()