def init_graphics(self): x, y = self.x, self.y poly_vertices = get_equilateral_vertices((x, y), self.size / 3) self.flat_poly = self.batch.add( 3, pyglet.gl.GL_TRIANGLES, self.group, ('v2f/stream', poly_vertices), ('c3B', (50, 50, 255, 50, 50, 255, 50, 50, 255))) self.flat_poly.colors = self.color * 3 self.graphics.append(self.flat_poly)
def init_graphic(self): unit_origin = -100, -100 unit_radius = self.parent.radius batch = self.parent.batch equilateral_vertices = tools.get_equilateral_vertices(unit_origin, unit_radius) self.graphic = batch.add_indexed(3, pyglet.gl.GL_LINES, settings.MIDGROUND, [0, 1, 1, 2, 2, 0], ('v2f', equilateral_vertices), ('c3B', tuple([99]*9)) )
def init_graphics(self): x, y = self.x, self.y poly_vertices = get_equilateral_vertices((x, y), self.size/3) self.flat_poly = self.batch.add(3, pyglet.gl.GL_TRIANGLES, self.group, ('v2f/stream', poly_vertices), ('c3B', (50, 50, 255, 50, 50, 255, 50, 50, 255)) ) self.flat_poly.colors = self.color*3 self.graphics.append(self.flat_poly)