當前位置: 首頁>>代碼示例>>Python>>正文


Python Panel.border_image方法代碼示例

本文整理匯總了Python中panel.Panel.border_image方法的典型用法代碼示例。如果您正苦於以下問題:Python Panel.border_image方法的具體用法?Python Panel.border_image怎麽用?Python Panel.border_image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在panel.Panel的用法示例。


在下文中一共展示了Panel.border_image方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_panels

# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import border_image [as 別名]
    def create_panels(self):
        """
        Build game panels that move around and show at various model states.

        """

        score_panel = Panel(SCORE_BOX.size, DRAW_AREA)
        score_panel.background_image = pygame.image.load(data.load('puzzle_info_bg.png')).convert()
        score_panel.border_image = pygame.image.load(data.load('puzzle_info.png')).convert()
        score_panel.border_image.set_colorkey(color.magenta)
        score_panel.show_position = SCORE_BOX.topleft
        score_panel.hide_position = (- SCORE_BOX.width, 0)
        score_panel.hide(instant=True)
        self.panels['score'] = score_panel

        puzzle_panel = Panel(PUZZLE_POS.size, DRAW_AREA)
        puzzle_panel.background_image = pygame.image.load(data.load('puzzle_bg.png')).convert()
        puzzle_panel.border_image = pygame.image.load(data.load('puzzle.png')).convert()
        puzzle_panel.border_image.set_colorkey(color.magenta)
        puzzle_panel.show_position = PUZZLE_POS.topleft
        puzzle_panel.hide_position = DRAW_AREA.bottomright
        puzzle_panel.hide(instant=True)
        self.panels['puzzle'] = puzzle_panel

        arcade_panel = Panel(ARCADE_POS.size, DRAW_AREA)
        arcade_panel.background_image = pygame.image.load(data.load('arcade_bg.png')).convert()
        arcade_panel.border_image = pygame.image.load(data.load('arcade.png')).convert()
        arcade_panel.border_image.set_colorkey(color.magenta)
        earth = pygame.image.load(data.load('earth.png')).convert()
        earth.set_colorkey(color.magenta)
        somewhere_over_the_rainbow = (random.randint(0, ARCADE_POS.width), random.randint(0, ARCADE_POS.height))
        arcade_panel.background_image.blit(earth, somewhere_over_the_rainbow)
        arcade_panel.hide_position = (0, ARCADE_POS.height)
        arcade_panel.hide(instant=True)
        self.panels['arcade'] = arcade_panel

        results_screen = pygame.image.load(data.load('results.png')).convert()
        results_panel = Panel(results_screen.get_size(), DRAW_AREA)
        results_panel.background_image = results_screen
        results_panel.show_position = (
            (DRAW_AREA.width - results_panel.rect.width) / 2,
            (DRAW_AREA.height - results_panel.rect.height) / 2)
        results_panel.hide_position = (DRAW_AREA.width, 0)
        results_panel.hide(instant=True)
        self.panels['results'] = results_panel

        msg_panel = Panel(MESSAGE_POS.size, DRAW_AREA)
        msg_panel.background_image = pygame.image.load(data.load('messages_bg.png')).convert()
        msg_panel.border_image = pygame.image.load(data.load('messages.png')).convert()
        msg_panel.border_image.set_colorkey(color.magenta)
        msg_panel.show_position = MESSAGE_POS.topleft
        msg_panel.hide_position = DRAW_AREA.topright
        msg_panel.hide(instant=True)
        self.panels['messages'] = msg_panel
開發者ID:wesleywerner,項目名稱:mooncrete,代碼行數:56,代碼來源:view.py


注:本文中的panel.Panel.border_image方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。