extends Panel func _ready(): Global.connect("level_map_updated", self, "draw") self.draw() func draw(): var Cell = load("res://UI/HUD/LevelMapCell.tscn") var Level = get_parent().get_parent() # HUD > Level for idx in range(Global.Level_Map.size()): var cell = Cell.instance() cell.level_idx = idx cell.set_rect_size(150/3, 150/3) var column = idx % 3 var row = idx / 3 cell.rect_position.x = cell.rect_size.x*column cell.rect_position.y = cell.rect_size.y*row #if idx == Level.idx: #cell.set_border_width_all(3) self.add_child(cell)