本文整理汇总了Python中Window.display方法的典型用法代码示例。如果您正苦于以下问题:Python Window.display方法的具体用法?Python Window.display怎么用?Python Window.display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SFTaxiTest
# 需要导入模块: import Window [as 别名]
# 或者: from Window import display [as 别名]
def SFTaxiTest(polies,verts):
sfTaxiShader= SFTaxiShader([poly.centroid for poly in polies])
window= Window()
mouseCursor= MouseCursor(window)
sfObjects= SFObjects(polies,verts)
clickPos=None ; clock = sf.Clock()
while window.is_open:
tDelta= clock.restart().seconds
sfObjects.setScale(window.view.size.x/window.size.x)
window.clear()
#window.draw(sfTaxiShader)
sfTaxiShader.quad.align(window)
sfObjects.quadCorners = sfTaxiShader.quad.corners()
sfObjects.updateRays(sfTaxiShader.corners())
window.draw(sfObjects)
window.draw(mouseCursor)
window.display()
checkNavKeys(window,tDelta,mouseCursor.pos)
for event in window.events:
if type(event) is sf.CloseEvent: window.close()
elif type(event) is sf.MouseButtonEvent and event.pressed:
if event.button==sf.Mouse.LEFT: sfObjects.clickedAt(mouseCursor.pos)
else: checkForNavEvents(window,event,mouseCursor.pos)
elif type(event) is sf.KeyEvent and event.pressed:
if event.code == sf.Keyboard.ESCAPE: window.close()
elif event.code == sf.Keyboard.P: sfObjects.clickedAt= selectPoly
elif event.code == sf.Keyboard.I: sfObjects.clickedAt= selectIntersect
else: checkForNavEvents(window,event,mouseCursor.pos)
else: checkForNavEvents(window,event,mouseCursor.pos)
示例2: main
# 需要导入模块: import Window [as 别名]
# 或者: from Window import display [as 别名]
def main():
w = Window()
w.display()