当前位置: 首页>>代码示例>>Python>>正文


Python UI.drawInfo方法代码示例

本文整理汇总了Python中UI.drawInfo方法的典型用法代码示例。如果您正苦于以下问题:Python UI.drawInfo方法的具体用法?Python UI.drawInfo怎么用?Python UI.drawInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UI的用法示例。


在下文中一共展示了UI.drawInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: import UI [as 别名]
# 或者: from UI import drawInfo [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)
开发者ID:CaseSwitchAdam,项目名称:rPepG,代码行数:33,代码来源:main.py


注:本文中的UI.drawInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。