本文整理汇总了Python中dialog.Dialog.draw方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.draw方法的具体用法?Python Dialog.draw怎么用?Python Dialog.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Interface
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import draw [as 别名]
class Interface(object):
def __init__(self, world):
self.world = world
self.load_image = self.world.load_image
self.display = world.display
self.menu = MainMenu(self)
self.dialog = Dialog(self, self.display)
self.state = ""
def show_dialog(self, owner, player, handler):
self.dialog.init_dialog(owner, player, handler)
self.state = "dialog"
self.world.state = "itf"
def show_menu(self, state="game"):
self.menu.set_state(state)
self.state = "menu"
self.world.state = "itf"
def return_event(self):
for event in pygame.event.get():
if event.type == KEYDOWN:
return event
else:
return EmptyEvent()
def draw(self):
if self.state == "menu":
self.menu.key_loop(self.return_event())
self.menu.draw(self.display)
elif self.state == "dialog":
self.dialog.key_loop(self.return_event())
self.dialog.draw()
else:
self.world.state = "game"
示例2: draw
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import draw [as 别名]
def draw(self, renderer):
#print "drawing!!!"
return Dialog.draw(self, renderer)