本文整理匯總了Python中panel.Panel.hide_position方法的典型用法代碼示例。如果您正苦於以下問題:Python Panel.hide_position方法的具體用法?Python Panel.hide_position怎麽用?Python Panel.hide_position使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panel.Panel
的用法示例。
在下文中一共展示了Panel.hide_position方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_panels
# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import hide_position [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