本文整理汇总了Python中pyglet.window.Window.set_fullscreen方法的典型用法代码示例。如果您正苦于以下问题:Python Window.set_fullscreen方法的具体用法?Python Window.set_fullscreen怎么用?Python Window.set_fullscreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyglet.window.Window
的用法示例。
在下文中一共展示了Window.set_fullscreen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: App
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import set_fullscreen [as 别名]
class App(object):
def __init__(self, pmap):
self.world = World(pmap)
self.win = Window(width=pmap['bounds'][2], height=pmap['bounds'][3])
# pyglet.clock.set_fps_limit(10)
# pyglet.clock.set_fps_limit(60)
self.win.push_handlers(self.on_key_press)
self.fullscreen = False
def main_loop(self):
self.world.annealing.kickoff()
while not (self.win.has_exit or self.world.finished):
self.win.dispatch_events()
if (not self.world.finished) and (not self.world.pause):
self.world.update()
if (self.world.showvisuals):
self.world.draw()
pyglet.clock.tick()
self.win.flip()
self.win.close()
def on_key_press(self, symbol, modifiers):
# IDEA more key toggles, make it a dictionary
if symbol == key.D:
self.world.showdebug = not self.world.showdebug
elif symbol == key.F:
self.fullscreen = not self.fullscreen
self.win.set_fullscreen(fullscreen=self.fullscreen)
self.world.draw()
elif symbol == key.G:
self.world.showgrid = not self.world.showgrid
elif symbol == key.S:
self.world.pause = not self.world.pause
elif symbol == key.U:
self.world.showUI = not self.world.showUI
elif symbol == key.V:
self.world.showvisuals = not self.world.showvisuals