def __init__(self, border): self.border = border sf.VertexArray.__init__(self, sf.PrimitiveType.LINES_STRIP, 4) self[1].position = border.lines[1][0] self[2].position = border.lines[1][1] for i in [0, 1, 2, 3]: self[i].color = sf.Color.BLACK self.vertCircle = SFCircle(oc=sf.Color.RED, ic=sf.Color.TRANSPARENT)
def __init__(self, polies, verts): sf.Drawable.__init__(self) self.polies = polies self.verts = verts P = [poly.centroid for poly in polies] self.sfPolies = { tuple(P[i]): SFPoly(polies[i], verts) for i in range(len(polies)) } self.clickedAt = self.selectPoly self.selectedPoly = None self.vertCirc = SFCircle(oc=sf.Color.TRANSPARENT, ic=sf.Color(0, 0, 255, 128)) self.pc = 0 self.text = Text()