This repository has been archived on 2025-09-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
rectangular/core/dynamic_polygon.gd
2024-09-25 21:18:58 +02:00

20 lines
314 B
GDScript

@tool
extends CollisionPolygon2D
@export var color: Color = Color.WHITE:
set(v):
color = v
update_polygon()
get():
return color
@export var update: bool:
set(v):
update_polygon()
func update_polygon():
$Polygon2D.polygon = polygon
$Polygon2D.color = color
func _ready() -> void:
update_polygon()