コード例 #1
0
ファイル: widget.py プロジェクト: bunions1/fallingSandGpu
 def draw(self):
     draw.set_color(color=self.main_color)
     pyglet.gl.glLineWidth(2.0)
     draw.line(self.x, self.y, self.x+self.width, self.y)
     pyglet.gl.glLineWidth(1.0)
     slider_x = self.x + self.width * self.position
     draw.set_color(color=self.outline_color)
     pyglet.gl.glPointSize(self.size)
     draw.points((slider_x, self.y))
     draw.set_color(color=self.main_color)
     pyglet.gl.glPointSize(self.size-2)
     draw.points((slider_x, self.y))
コード例 #2
0
ファイル: gui.py プロジェクト: irskep/splatterboard
 def draw(self):    
     if not self.visible: return
     super(PolygonButton, self).draw()
     
     x, y = self.x+self.width/2, self.y+self.height/2
     poly = self.generate_polygon(x,y,x,self.y+self.height*0.9,self.sides)
     if self.fill:
         if graphics.fill_rainbow():
             graphics.set_color(1,1,1,1)
         else:
             graphics.set_color(color=graphics.fill_color)
         draw.polygon(poly)
     if self.outline:
         graphics.set_line_width(2)
         if graphics.line_rainbow():
             graphics.set_color(1,1,1,1)
         else:
             graphics.set_color(color=graphics.line_color)
         draw.line_loop(poly)
         draw.points(poly)
コード例 #3
0
ファイル: tool.py プロジェクト: irskep/splatterboard
 def draw_brush():
     graphics.set_color(0,0,0,1)
     graphics.set_line_width(size)
     draw.points((x+w/2,y+h/2))