def draw(self): r = self.size.x gl.glColor3f(1.0, .7, 0.0) with shiftView(self.body.position): gl.glBegin(gl.GL_LINE_LOOP) for angle in xrange(0, 360, 360/12): gl.glVertex2f(*self.size.rotated_degrees(angle)) gl.glEnd()
def draw(self, colour=(0., 0., 1.)): s = self.size # shorthand gl.glColor3f(*colour) with shiftView(self.pos): gl.glBegin(gl.GL_LINE_LOOP) gl.glVertex2f(-s.x, +s.y) gl.glVertex2f(+s.x, +s.y) gl.glVertex2f(+s.x, -s.y) gl.glVertex2f(-s.x, -s.y) gl.glEnd()
def draw(self): #print self.body.postion s = self.size # just a shorthand gl.glColor4f(*(self.colour + (self.opacity,))) with shiftView(Vec2d(self.body.position)): gl.glRotatef(degrees(self.body.angle), 0.1,0.2,1.0) gl.glBegin(gl.GL_POLYGON) for vertex in self.verticies: gl.glVertex2f(*vertex) gl.glEnd()
def draw(self): s = self.size # shorthand gl.glColor3f(0.7, 0.0, 0.0) with shiftView(self.pos): gl.glBegin(gl.GL_LINES) gl.glVertex2f(+s.x, +s.y) gl.glVertex2f(-s.x, -s.y) gl.glVertex2f(-s.x, +s.y) gl.glVertex2f(+s.x, -s.y) gl.glEnd()
def draw(self): with shiftView(self.pos): gl.glColor3f(1.0, 0.0, 0.0) gl.glBegin(gl.GL_TRIANGLE_FAN) gl.glVertex2f(0, 0) for i in xrange(0, 365, 5): gl.glVertex2f(*self.size.rotated_degrees(i)) gl.glEnd() gl.glRotatef(degrees(self.body.angle), 0, 0, 1) gl.glColor3f(1.0, 0.0, 1.0) gl.glBegin(gl.GL_LINES) gl.glVertex2f(0,0) gl.glVertex2f(*Vec2d(30, 0).rotated(self.input.currentAim)) gl.glEnd()
def draw(self): with shiftView(self.pos - self.size): tex = game.resources.textures['platform'] #tex.blit(0,0, 0, *(self.size*2)) self.pySprite.draw()