예제 #1
0
    def drag(self, pos):
        if not self.last_drag_pos:
            self.last_drag_pos = self.start_drag
        delta = ui._subpoints(self.last_drag_pos, pos)
        self.last_drag_pos = pos

        self.drawer.move_map(delta)
예제 #2
0
    def drag(self, pos):
        if not self.last_drag_pos:
            self.last_drag_pos = self.start_drag
        delta = ui._subpoints(self.last_drag_pos, pos)
        self.last_drag_pos = pos

        self.drawer.move_map(delta)
예제 #3
0
 def drag(self, pos):
     if not self.last_drag_pos:
         self.last_drag_pos = self.start_drag
     delta = ui._subpoints(self.last_drag_pos, pos)
     x, y = freeciv.func.get_map_view_origin()
     #print 'drag', x + delta[0], y + delta[1]
     freeciv.func.set_mapview_origin(x + delta[0], y + delta[1])
     self.last_drag_pos = pos
예제 #4
0
 def drag(self, pos):
     if not self.last_drag_pos:
         self.last_drag_pos = self.start_drag
     delta = ui._subpoints(self.last_drag_pos, pos)
     x, y = freeciv.func.get_map_view_origin()
     #print 'drag', x + delta[0], y + delta[1]
     freeciv.func.set_mapview_origin(x + delta[0], y + delta[1])
     self.last_drag_pos = pos
예제 #5
0
    def draw_clipped(self, surf, pos, clip):
        rect = graphics.Rect(clip)
        cliptex = graphics.create_surface(rect[2], rect[3])
        relpos = ui._subpoints(pos, (rect[0], rect[1]))

        self.draw(cliptex, relpos)

        surf.blit(cliptex, (rect[0], rect[1]))
예제 #6
0
    def draw_clipped(self, surf, pos, clip):
        rect = graphics.Rect(clip)
        cliptex = graphics.create_surface(rect[2], rect[3])
        relpos = ui._subpoints(pos, (rect[0], rect[1]))

        self.draw(cliptex, relpos)

        surf.blit(cliptex, (rect[0], rect[1]))
예제 #7
0
 def event(self, ev):
     if ev.type == pygame.MOUSEBUTTONDOWN:
         myabspos = ui._subpoints(ev.abs_pos, ev.pos)
         self.shown = True
         ui.add_overlay(self.scroll, myabspos)
     elif ev.type == pygame.MOUSEBUTTONUP:
         self.shown = False
         if self.scroll in ui.overlays:
             ui.overlays.remove(self.scroll)
예제 #8
0
 def event(self, ev):
     if ev.type == pygame.MOUSEBUTTONDOWN:
         myabspos = ui._subpoints(ev.abs_pos, ev.pos)
         self.shown = True
         ui.add_overlay(self.scroll, myabspos)
     elif ev.type == pygame.MOUSEBUTTONUP:
         self.shown = False
         if self.scroll in ui.overlays:
             ui.overlays.remove(self.scroll)