本文整理汇总了Python中Resources.image方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.image方法的具体用法?Python Resources.image怎么用?Python Resources.image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import image [as 别名]
def __init__(self, fullscreen, width):
"""Initializes the main window."""
global _mainWindow
_mainWindow = self
self._input = Input.Input(0)
self._limitFPS = True
self._fullscreen = fullscreen
self._fullscreenSize = self._chooseDisplaySize()
self._defaultSize = (width, width*3/4)
if fullscreen:
self._size = self._fullscreenSize
else:
self._size = self._defaultSize
self._fpsDisplayer = Sprite.FPSDisplayer()
self._delegate = None
self._soundEnabled = True
pygame.display.set_icon(Resources.image("icon-32"))
self._setDisplayMode()
self._resize()
self._initOpenGL()
if self._fullscreen:
pygame.mouse.set_pos((0, 0))
示例2: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import image [as 别名]
def __init__(self, unit, delay=0.0, attackStyle="melee"):
# Number of frames of the attack animation
self._maxFrame = unit.getSprites(attackStyle).__len__()
if self._maxFrame == 0:
attackStyle = 'standing'
self._maxFrame = unit.getSprites(attackStyle).__len__()
# Load the textures
self._unitHand = []
self._texture = []
for image in unit.getSprites(attackStyle):
self._texture.append(GLUtil.makeTexture(Resources.image(image))[0])
self._unitHand.append(Resources.spriteConfig.hand(image))
# Load the weapon textures
self._wtexture = None
self._weapGrip = None
if unit.weapon() != None:
wimage = unit.weapon().getSprites('standing')[0]
if wimage != None:
self._wtexture = GLUtil.makeTexture(Resources.image(wimage))[0]
self._weapGrip = Resources.spriteConfig.grip(wimage)
else:
wimage = None
# Load the over textures
self._otexture = []
if wimage != None:
oimages = unit.getOverSprites(attackStyle)
if len(oimages) < self._maxFrame:
oimages = []
for image in oimages:
self._otexture.append(
GLUtil.makeTexture(Resources.image(image))[0])
self._unitdisplayer = ScenarioGUI.get().unitDisplayer(unit)
self._unitdisplayer.Acting()
self._time = -delay
self._frame = 0