本文整理汇总了Python中Resources.loadPNG方法的典型用法代码示例。如果您正苦于以下问题:Python Resources.loadPNG方法的具体用法?Python Resources.loadPNG怎么用?Python Resources.loadPNG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resources
的用法示例。
在下文中一共展示了Resources.loadPNG方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resetColor
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import loadPNG [as 别名]
def resetColor(self, color):
self.arrAnim = []
for i in range(0, self.nbFrames):
if i + 1 < 10:
self.arrAnim.append(Resources.loadPNG(self.imageName + "000" + str(i + 1) + ".png", True))
elif i + 1 < 100:
self.arrAnim.append(Resources.loadPNG(self.imageName + "00" + str(i + 1) + ".png", True))
else:
self.arrAnim.append(Resources.loadPNG(self.imageName + "0" + str(i + 1) + ".png", True))
for img in self.arrAnim:
img[0].fill(color, special_flags = BLEND_MULT)
示例2: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import loadPNG [as 别名]
def __init__(self, image, nbFrames):
pygame.sprite.Sprite.__init__(self)
self.flip = False
self.interval = 0
self.nbFrames = nbFrames
self.play = True
self.start = 0
self.end = nbFrames - 1
self.cyclic = True
self.imageName = image
self.arrAnim = []
for i in range(0, self.nbFrames):
if i + 1 < 10:
self.arrAnim.append(Resources.loadPNG(self.imageName + "000" + str(i + 1) + ".png", True))
elif i + 1 < 100:
self.arrAnim.append(Resources.loadPNG(self.imageName + "00" + str(i + 1) + ".png", True))
else:
self.arrAnim.append(Resources.loadPNG(self.imageName + "0" + str(i + 1) + ".png", True))
self.currentFrameNb = self.start
self.image, self.rect = self.arrAnim[self.currentFrameNb]
示例3: __init__
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import loadPNG [as 别名]
def __init__(self, id = -1, x = 0, y = 0, type = "earth"):
self.typeList = {"earth":"earth.png", "ice":"ice.png", "carrot":"carrot.png", "boing":"boing.png"}
self.id = id
self.posX = x
self.posY = y
self.type = type
self.friction = 0.7
if self.type == "ice":
self.friction == 0.2
if self.type == "empty":
self.rect = pygame.Rect(0, 0, 0, 0)
else:
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = Resources.loadPNG(self.typeList[self.type])
self.rect.topleft = (self.posX, self.posY)
示例4: replaceImage
# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import loadPNG [as 别名]
def replaceImage(self, objType, isFloor = False):
if isFloor or self.type == "boing":
self.image = Resources.loadPNG(self.typeList[objType])[0]
else:
self.image = Resources.loadPNG("middle_" + self.typeList[objType])[0]