コード例 #1
0
ファイル: colorpicker.py プロジェクト: irskep/splatterboard
 def draw(self):
     """Render the image if it has not been rendered yet. Just draw the image if it has."""
     if self.rendered:
         graphics.set_color(1,1,1,1)
         draw.image(self.image,self.x,self.y)
     else:
         self.rendered = True
         self.draw_initial()
     graphics.set_color(0,0,0,1)
     graphics.set_line_width(1)
     draw.rect_outline(self.x,self.y,self.x+self.width,self.y+self.height)
コード例 #2
0
ファイル: gui.py プロジェクト: irskep/splatterboard
 def draw(self):
     if self.which_color == 0:
         if graphics.line_rainbow():
             draw.rainbow(self.x,self.y,self.x+self.width,self.y+self.height)
         else:
             graphics.set_color(color=graphics.line_color)
             draw.rect(self.x, self.y, self.x+self.width, self.y+self.height)
     else:
         if graphics.fill_rainbow():
             draw.rainbow(self.x,self.y,self.x+self.width,self.y+self.height)
         else:
             graphics.set_color(color=graphics.fill_color)
             draw.rect(self.x, self.y, self.x+self.width, self.y+self.height)
     
     if self.selected:
         graphics.set_color(1,1,1,1)
         graphics.set_line_width(1)
         draw.ellipse_outline(self.x+5, self.y+5, self.x+self.width-5, self.y+self.height-5)
         graphics.set_color(0,0,0,1)
         draw.ellipse_outline(self.x+7, self.y+7, self.x+self.width-7, self.y+self.height-7)
     graphics.set_line_width(1.0)    
     graphics.set_color(0,0,0,1)
     draw.rect_outline(self.x, self.y, self.x+self.width, self.y+self.height)
コード例 #3
0
ファイル: widget.py プロジェクト: bunions1/fallingSandGpu
 def draw(self):
     draw.set_color(*self.color)
     draw.rect_outline(self.x, self.y, self.x+self.w, self.y+self.h)