本文整理汇总了Python中application.Application.render方法的典型用法代码示例。如果您正苦于以下问题:Python Application.render方法的具体用法?Python Application.render怎么用?Python Application.render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import render [as 别名]
def main():
# set up pygame
pygame.init()
# set up the window
window_surface = pygame.display.set_mode((1024, 768), pygame.DOUBLEBUF | pygame.HWSURFACE) #pygame.FULLSCREEN
pygame.display.set_caption(title)
fps_clock = pygame.time.Clock()
joysticks = []
for i in range(0, pygame.joystick.get_count()):
joysticks.append(pygame.joystick.Joystick(i))
joysticks[-1].init()
resources.set("joysticks", joysticks)
app = Application(window_surface)
resources.load()
window_active = True
# run the game loop
while True:
#read input
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == ACTIVEEVENT:
if event.state == 2:
window_active = False
elif event.state == 1:
window_active = True
elif event.state == 6:
window_active = False
#print event
else:
if window_active:
app.input(event)
if window_active:
app.update()
window_surface.fill(clearColor)
app.render()
pygame.display.update()
fps_clock.tick(resources.get("fps"))