本文整理汇总了Python中UI.render方法的典型用法代码示例。如果您正苦于以下问题:Python UI.render方法的具体用法?Python UI.render怎么用?Python UI.render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI.render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import UI [as 别名]
# 或者: from UI import render [as 别名]
elif event.type == KEYUP:
if event.key == K_DOWN:
player.yVelocity -= player.speed
elif event.key == K_UP:
player.yVelocity += player.speed
elif event.key == K_LEFT:
player.xVelocity += player.speed
elif event.key == K_RIGHT:
player.xVelocity -= player.speed
elif event.type == KEYDOWN:
if event.key == K_DOWN:
player.yVelocity += player.speed
elif event.key == K_UP:
player.yVelocity -= player.speed
elif event.key == K_LEFT:
player.xVelocity -= player.speed
elif event.key == K_RIGHT:
player.xVelocity += player.speed
#Here we render the ui on top of everything else. I do need to change
#the time of when this is rendered because it can overwrite some other
#needed information.
UI.render(25, 25, 10, 10, "Pinksquare Hills", "Pre-alpha")
UI.drawInfo(char, 78, 100, 24, 28)
#Lastly we call upon the update method of the display object so it will
#render at the specific time. Also, we specify the frame rate with the
#tick object on fpsClock.
pygame.display.update()
fpsClock.tick(60)