Exemple #1
0
 def place_highlight(self, rowcoltab, fill="red", **dict):
     """Highlight a hexagon. return its id on cfg.canvas"""
     pts = list(cfg.hexagon_generator(rowcoltab[0], rowcoltab[1], rowcoltab[2]))
     highid = cfg.canvas.create_line(pts, width=2, fill=fill, tag="high", **dict)
     self._highlight.append(tuple(rowcoltab))
     self._highlightids.append(highid)
     cfg.win.update()
     return highid
Exemple #2
0
 def create_hexagons():
     cfg.hexagon_generator = hg.HexagonGenerator(cfg.HEX_SIZE)
     for row in range(-10, cfg.ROWS + 30):
         for col in range(-10, cfg.COLS + 18):
             pts = list(cfg.hexagon_generator(row, col))
             self.canvas.create_line(pts, width = 2)