예제 #1
0
class NormalBottomBar(object):
    def __init__(self, state, app):
        self.state = state

        self.app = app

        self.end_turn_button = gui.Button(self.app, (635, 475), "NBB-ENDTURN", "End Turn", "bottomright")
        x, y = self.end_turn_button.rect.topright
        y -= 5
        self.draw_button = gui.Button(self.app, (x,  y), "NBB-DRAWTERR", "Expand", "bottomright")
        self.draw_button.over_width = self.end_turn_button.rect.width
        self.draw_button.make_image()

        self.minimap = Minimap(state, pygame.Rect(15, 390, 82, 82))

    def render_bg(self, screen):
        screen.blit(data.image("hud_bg_bottom.png"), (0,380))
        map = self.minimap.update()
        screen.blit(map, self.minimap.rect)

    def update(self):
        if pygame.mouse.get_pressed()[0]:
            pos = pygame.mouse.get_pos()
            if self.minimap.rect.collidepoint(pos):
                # Localize passed click..
                self.minimap.map_click((pos[0] - self.minimap.rect.left,
                    pos[1] - self.minimap.rect.top))
예제 #2
0
    def __init__(self, state, app):
        self.state = state

        self.app = app

        self.end_turn_button = gui.Button(self.app, (635, 475), "NBB-ENDTURN", "End Turn", "bottomright")
        x, y = self.end_turn_button.rect.topright
        y -= 5
        self.draw_button = gui.Button(self.app, (x,  y), "NBB-DRAWTERR", "Expand", "bottomright")
        self.draw_button.over_width = self.end_turn_button.rect.width
        self.draw_button.make_image()

        self.minimap = Minimap(state, pygame.Rect(15, 390, 82, 82))