Beispiel #1
0
  def draw(self, canvas):
    Plato.draw(self, canvas)
    
    
    # draw a square
    #canvas.set_line_width(1.0)
    #canvas.set_source_rgba(0.7, 1.0, 0.7, 0.5)
    #canvas.rectangle(self.left, self.top, self.width, self.height)
    #canvas.fill()    

    Primitives.rounded_rectangle(canvas, self.left, self.top, self.width, self.height)
    
    # some numbers
    l1 = str((int(self.x),int(self.y))) 
    l2 = 'local:' + str((int(self.width),int(self.height))) 
    l3 = 'world:' + str((int(self.world_width),int(self.world_height)))
    l4 = 'rot:' + str(self.rotation)
    canvas.set_source_rgb(0,0,0)
    canvas.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
    canvas.set_font_size(16.0)
    canvas.move_to(self.left+10,self.top + 30.0)
    canvas.show_text(l1)
    canvas.move_to(self.left+10,self.top + 60.0)
    canvas.show_text(l2)
    canvas.move_to(self.left+10,self.top + 90.0)
    canvas.show_text(l3)
    canvas.move_to(self.left+10,self.top + 120.0)
    canvas.show_text(l4)