本文整理汇总了Python中Menu.drawMenu方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.drawMenu方法的具体用法?Python Menu.drawMenu怎么用?Python Menu.drawMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.drawMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: redrawAll
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import drawMenu [as 别名]
def redrawAll(data):
data.map.resetMap()
#ProtossBuildings.ProtossBuilding.drawAllBuildings()
Building.building.drawAllBuildings()
Unit.Unit.drawAllUnits()
data.map.draw(data.screen)
data.map.drawFogOfWar(data.screen,data.currentPlayer.index)
if isinstance(data.selected,Unit.Unit):
if data.buildMode == False and data.placeMode == False:
if data.selected.canMove:
if data.buttonStatus[0] == 1:
data.selected.drawMoves((0,200,0,100))
if data.selected.canAttack:
if data.buttonStatus[1] == 1:
data.selected.drawAttack((200,0,0,100))
#drawGrid(data)
drawMenu(data)
Menu.drawMenu(data.screen, data.selected, data)
Menu.drawAllBuildingsOnMiniMap(data.screen,data)
Menu.drawAllUnitsOnMiniMap(data.screen,data)
data.map.drawFogOfWarOnMiniMap(data.screen,data.currentPlayer.index)
data.ViewBox.draw()
drawSelected(data)
if data.mode == 'pause':
data.screen.blit(data.pauseMenu,(180,150))
elif data.mode == 'help':
data.screen.blit(load.load_image('Other/Help.png'),(0,0))
pygame.display.flip()
示例2: main
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import drawMenu [as 别名]
def main():
# pygame initialization
pygame.init()
pygame.mixer.music.load('sounds/menu.mp3')
pygame.mixer.music.play(-1)
pygame.display.set_caption('PyFighters')
pygame.mouse.set_visible(1)
clock = pygame.time.Clock()
# code for our menu
ourMenu = ("Play Online",
"How to play",
"Statistics",
"Exit")
myMenu = Menu(ourMenu)
myMenu.drawMenu()
pygame.display.flip()
# main loop for event handling and drawing
while 1:
clock.tick(60)
# Handle Input Events
for event in pygame.event.get():
myMenu.handleEvent(event)
# quit the game if escape is pressed
if event.type == QUIT:
sys.exit(0)
elif event.type == Menu.MENUCLICKEDEVENT:
if event.text == "Play Online":
time.sleep(1)
character = CharSelect.charselect()
print "Just Waiting..."
InitScript.main(socketInit(), character)
elif event.text == "How to play":
Settings.settings()
elif event.text == "Local Play":
Script.main()
elif event.text == "Exit":
sys.exit(0)
elif event.type == KEYDOWN and event.key == K_ESCAPE:
myMenu.activate()
sys.exit(0)
if myMenu.isActive():
myMenu.drawMenu()
pygame.display.flip()