本文整理汇总了Python中state.State.pop_screen方法的典型用法代码示例。如果您正苦于以下问题:Python State.pop_screen方法的具体用法?Python State.pop_screen怎么用?Python State.pop_screen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.pop_screen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import pop_screen [as 别名]
def update(self, events):
'''
Updates the screen when an event happens
@param - list of game events
'''
for event in events:
if not hasattr(event, 'key'):
continue
if event.type == KEYDOWN:
if event.key == K_p:
State.pop_screen()
elif event.key == K_RETURN:
self.sounds['select'].play()
if self.currLine == PauseScreenLines.Resume:
State.pop_screen()
if self.currLine == PauseScreenLines.Save:
self.tileMap.save(self.player)
save(USER_SAVES_DIR + State.save_name)
elif self.currLine == PauseScreenLines.Quit:
State.pop_screen()
State.pop_screen()
elif event.key == K_i:
State.push_screen(InventoryScreen(self.player))
else:
super(PauseScreen, self).interact(event)
示例2: update
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import pop_screen [as 别名]
def update(self, events):
'''
Updates the screen when an event happens
@param - list of game events
'''
for event in events:
if not hasattr(event, 'key'):
continue
if event.type == KEYDOWN:
if event.key == K_RETURN:
if self.currLine == LoadGameScreenLine.ReturnToMainMenu:
State.pop_screen()
continue
save_name = self.lines[self.currLine]
load(USER_SAVES_DIR + save_name)
State.save_name = save_name
State.pop_screen()
State.push_screen(gameScreen.GameScreen(CURRENT_GAME_DIR))
else:
super(LoadGameScreen, self).interact(event)