def draw_hexagon(self, ctx): """Create the polygon, filled with the terrain color.""" if self.selected: # outer portion ctx.set_source_rgb(1, 1, 1) guiutils.draw_polygon(ctx, self.points) ctx.fill() # inner hex ctx.set_source_rgb(*self.fillcolor) guiutils.draw_polygon(ctx, self.inner_vertexes) ctx.fill() # black outline ctx.set_source_rgb(0, 0, 0) guiutils.draw_polygon(ctx, self.points) ctx.stroke() else: # hex ctx.set_source_rgb(*self.fillcolor) guiutils.draw_polygon(ctx, self.points) ctx.fill() # outline ctx.set_source_rgb(1, 1, 1) guiutils.draw_polygon(ctx, self.points) ctx.stroke()
def draw_selection(self, ctx): """If the hex is selected, draw the red outline.""" if self.selected: ctx.set_source_rgba(1, 0, 0, 0.8) guiutils.draw_polygon(ctx, self.points) ctx.stroke()
def draw_hexagon(self, ctx): """Create the polygon, filled with the terrain color.""" # inner hex ctx.set_source_rgb(*self.fillcolor) guiutils.draw_polygon(ctx, self.points) ctx.fill()