tool
extends Polygon2D
class_name ItemOutline, "res://addons/escoria-core/design/esc_item.svg"

export(Color) var OutLine = Color(0,0,0) setget set_outline_color
export(float) var Width = 2.0 setget set_outline_width

func _draw():
    var poly = get_polygon()
    for i in range(1 , poly.size()):
        draw_line(poly[i-1] , poly[i], OutLine , Width)
    draw_line(poly[poly.size() - 1] , poly[0], OutLine , Width)

func set_outline_color(color):
    OutLine = color
    update()

func set_outline_width(new_width):
    Width = new_width
    update()