extends TextureRect

var castBar

func _init(pos, size):
  set_position(pos)
  set_size(size)

func _ready():
  castBar = ColorRect.new()
  castBar.color = Color(0, 0, 1, 0.5)
  castBar.set_size(Vector2(0, get_rect().size.y))
  add_child(castBar)

func setProgress(progress):
  castBar.set_size(Vector2(progress * get_rect().size.x , get_rect().size.y))