Example #1
0
 def _paint_tile(self, pixel):
     if ui_cfg.base_style == 1:
         BoardTools.draw_vertical_hexagon(self.canvas, pixel, \
                 self.hex_radius, self._get_base_options())
     elif ui_cfg.base_style == 2:
         BoardTools.draw_rect(self.canvas, pixel, \
                 self.hex_radius, self._get_base_options())
Example #2
0
    def paint(self, sector_function):
        for i in xrange(self.major):
            for j in xrange(self.minor):
                if j % 2 == 1 and i == self.major - 1:
                    continue

                visual_pos = (i, j)
                bp = BoardTools.get_backend_position_for_visual_position( \
                        visual_pos, self.minor)

                sector = sector_function(bp)
                hex_options = self._get_hexagon_options(sector)

                pixel = self.get_center_pixel_for_visual_position(visual_pos)
                BoardTools.draw_vertical_hexagon(self.canvas, pixel, \
                        self.hex_radius, hex_options)

                BoardTestTools.draw_backend_coordinates(self.canvas, \
                        visual_pos, pixel, \
                        self.hex_radius, self.minor)