本文整理汇总了Python中Resources.load_image方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.load_image方法的具体用法?Python Resources.load_image怎么用?Python Resources.load_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.load_image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import load_image [as 别名]
def __init__(self, director, position, visible, player=None):
bgStyle = createHUDStyle(Resources.load_image("HUD_bg.png"))
Container.__init__(self, director, position, bgStyle, visible)
buttonImage = Resources.load_image("active_button.png")
objectImage = pygame.Surface((2, 2))
activeButtonStyle = ContainerButton.createContainerButtonStyle(buttonImage, objectImage, 78)
self.leftButton = ImageButton.ImageButton(self.director, (180, 15), activeButtonStyle)
self.rightButton = ImageButton.ImageButton(self.director, (542, 15), activeButtonStyle)
Container.addWidget(self, self.leftButton)
Container.addWidget(self, self.rightButton)
self.hidden = True
self.player = player
self.originalPosition = self.position
self.lastEvent = None
self.newEvent = False
示例2: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import load_image [as 别名]
def __init__(self, director, pausedScene, title='Warning!', message='Message', tooltip='Press here to continue'):
Scene.__init__(self, director)
self.bluredBackground = None
self.b = 1
self.pausedScene = pausedScene
layer = Layer(director)
backgroundImage = Resources.load_image("message_box.png")
buttonImage = Resources.load_image("message_box_button.png")
buttonWidth = 372
style = MessageBox.createMessageBoxStyle(
backgroundImage, buttonImage, buttonWidth)
self.messageBox = MessageBox.MessageBox(
self.director, (SCREEN_W / 2 - style['bg'].get_width() / 2, SCREEN_H / 2 - style['bg'].get_height() / 2), style, True)
self.messageBox.button.onMouseDown = lambda: self.popScene()
self.messageBox.title = title
self.messageBox.message = message
self.messageBox.tooltip = tooltip
layer.append(self.messageBox)
self.layers.append(layer)