예제 #1
0
def mouse_rightdrag(start, stop):
    color = random_color()
    size = start - stop
    size = int(size.length())
    if size < 10:
        size = 10
    Entities.spawn_rectangle(start, size, Physics.Vec2(0, 0), Physics.Vec2(0, 0), 10, color, mod=Entities.Object.MOVABLE)
예제 #2
0
 def mouse_rightdrag(self, start, stop):
     color = random_color()
     start = Physics.Vec2(start[0], start[1])
     stop = Physics.Vec2(stop[0], stop[1])
     size = start - stop
     size = int(size.length())
     if size < 10:
         size = 10
     Entities.spawn_rectangle(start, size, Physics.Vec2(0, 0), Physics.Vec2(0, 0), 10, color)
     pygame.draw.rect(self.screen, color, Rect(start.x, start.y, size, size))
예제 #3
0
 def mouse_rightclick(self, pos):
     color = random_color()
     Entities.spawn_rectangle(Physics.Vec2(pos[0], pos[1]),
                             self.object_size, Physics.Vec2(0, 0), Physics.Vec2(0, 0), 10, color)
     pygame.draw.rect(self.screen, color, Rect(pos[0], pos[1], self.object_size, self.object_size))
예제 #4
0
def mouse_rightclick(pos):
    color = random_color()
    Entities.spawn_rectangle(pos,
                            10, Physics.Vec2(0, 0), Physics.Vec2(0, 0), 10, color, mod=Entities.Object.MOVABLE)