本文整理汇总了Python中Button.Button.setImage方法的典型用法代码示例。如果您正苦于以下问题:Python Button.setImage方法的具体用法?Python Button.setImage怎么用?Python Button.setImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button.Button
的用法示例。
在下文中一共展示了Button.setImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import setImage [as 别名]
else:
fullscreen = 0
screen = pygame.display.set_mode((width,height),fullscreen)
pygame.display.flip()
if event.type == pygame.KEYUP:
if (event.key == pygame.K_RALT or event.key == pygame.K_LALT):
altFlag = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN and not altFlag:
start = True
cutScreen = True
level = 1
if event.type == pygame.MOUSEBUTTONDOWN:
if mouseoption.collidePoint(event.pos):
mousecontrols= True
mouseoption.setImage("Images/backgrounds/mousebuttonclicked.png")
keyboardoption.setImage("Images/backgrounds/arrowkeysbutton.png")
if keyboardoption.collidePoint(event.pos):
mousecontrols= False
mouseoption.setImage("Images/backgrounds/mousebutton.png")
keyboardoption.setImage("Images/backgrounds/arrowkeysbuttonclicked.png")
if startbutton.collidePoint(event.pos):
start = True
cutScreen = True
level = 1
screen.blit(bgImage, bgRect)
screen.blit(startbutton.image, startbutton.rect)
screen.blit(mouseoption.image, mouseoption.rect)
screen.blit(keyboardoption.image, keyboardoption.rect)