def __init__(self, button_center, mouse_pos): RenderTree.__init__(self) vertices = [] x = button_center[0] y = button_center[1] vertices.append((x, y + 1)) vertices.append((x + mouse_pos[0], y + mouse_pos[1])) vertices.append((x + mouse_pos[0], y + mouse_pos[1] - 2)) vertices.append((x, y - 1)) self.pointer = Poly(vertices, color='white') self.add(self.pointer)
def __init__(self): RenderTree.__init__(self) self.linha_externa = Rectangle(TAM_LINHA_EXTERNA, color = 'white') self.linha_interna = Rectangle(TAM_LINHA_INTERNA, color = 'green') self.background = Rectangle((0, SCREEN_WIDTH, 0, SCREEN_HEIGHT), color = 'red') self.tabuleiro = Rectangle(TAM_TABULEIRO, color = 'green') self.garea_esquerda_linha = Rectangle(TAM_GRANDE_AREA_ESQUERDA_LINHA, color = 'white') self.garea_esquerda = Rectangle(TAM_GRANDE_AREA_ESQUERDA, color = 'green') self.garea_direita_linha = Rectangle(TAM_GRANDE_AREA_DIREITA_LINHA, color = 'white') self.garea_direita = Rectangle(TAM_GRANDE_AREA_DIREITA, color = 'green') self.peq_area_esquerda_linha = Rectangle(TAM_PEQ_AREA_ESQUERDA_LINHA, color = 'white') self.peq_area_esquerda = Rectangle(TAM_PEQ_AREA_ESQUERDA, color = 'green') self.peq_area_direita_linha = Rectangle(TAM_PEQ_AREA_DIREITA_LINHA, color = 'white') self.peq_area_direita = Rectangle(TAM_PEQ_AREA_DIREITA, color = 'green') self.circulo_central_grande_linha = Circle(RAIO_CIRCULO_CENTRAL, pos= (SCREEN_WIDTH/2, SCREEN_HEIGHT/2), color = 'white') self.circulo_central_grande = Circle(RAIO_CIRCULO_CENTRAL - LINHA_ESPESSURA, pos= (SCREEN_WIDTH/2, SCREEN_HEIGHT/2), color = 'green') self.circulo_central_peq = Circle(RAIO_BOLINHA, pos= (SCREEN_WIDTH/2, SCREEN_HEIGHT/2), color = 'white') self.circulo_esquerda_linha = Circle(RAIO_CIRCULO_CENTRAL, pos= (TAM_GRANDE_AREA_ESQUERDA[1], SCREEN_HEIGHT/2), color = 'white') self.circulo_esquerda = Circle(RAIO_CIRCULO_CENTRAL - LINHA_ESPESSURA, pos= (TAM_GRANDE_AREA_ESQUERDA[1], SCREEN_HEIGHT/2), color = 'green') self.circulo_direita_linha = Circle(RAIO_CIRCULO_CENTRAL, pos= (TAM_GRANDE_AREA_DIREITA[0], SCREEN_HEIGHT/2), color = 'white') self.circulo_direita = Circle(RAIO_CIRCULO_CENTRAL - LINHA_ESPESSURA, pos= (TAM_GRANDE_AREA_DIREITA[0], SCREEN_HEIGHT/2), color = 'green') self.reta_centro = Rectangle(TAM_RETA_CENTRO, color='white') self.marca_penalti_esquerda = Circle(RAIO_BOLINHA, pos=(W_DIFF + DIST_PENALTI ,SCREEN_HEIGHT/2), color='white') self.marca_penalti_direita = Circle(RAIO_BOLINHA, pos=(TAB_WIDTH - DIST_PENALTI, SCREEN_HEIGHT/2), color='white') self.add(self.background) self.add(self.tabuleiro) self.add(self.linha_externa) self.add(self.linha_interna) self.add(self.circulo_esquerda_linha) self.add(self.circulo_esquerda) self.add(self.circulo_direita_linha) self.add(self.circulo_direita) self.add(self.garea_esquerda_linha) self.add(self.garea_esquerda) self.add(self.garea_direita_linha) self.add(self.garea_direita) self.add(self.peq_area_esquerda_linha) self.add(self.peq_area_esquerda) self.add(self.peq_area_direita_linha) self.add(self.peq_area_direita) self.add(self.circulo_central_grande_linha) self.add(self.circulo_central_grande) self.add(self.circulo_central_peq) self.add(self.marca_penalti_esquerda) self.add(self.marca_penalti_direita) self.add(self.reta_centro)