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


Python Resources.load_image方法代码示例

本文整理汇总了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
开发者ID:hmourit,项目名称:Aleph,代码行数:17,代码来源:HUD.py

示例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)
开发者ID:dgalaktionov,项目名称:Aleph,代码行数:21,代码来源:MessageScene.py


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