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


Python Resources.loadPNG方法代码示例

本文整理汇总了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)
开发者ID:Barbatos,项目名称:BumpNJump,代码行数:14,代码来源:Animation.py

示例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]
开发者ID:Barbatos,项目名称:BumpNJump,代码行数:25,代码来源:Animation.py

示例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)
开发者ID:Barbatos,项目名称:BumpNJump,代码行数:22,代码来源:Object.py

示例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]
开发者ID:Barbatos,项目名称:BumpNJump,代码行数:7,代码来源:Object.py


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