本文整理汇总了Python中spritelib.loadIfNotInImageCache函数的典型用法代码示例。如果您正苦于以下问题:Python loadIfNotInImageCache函数的具体用法?Python loadIfNotInImageCache怎么用?Python loadIfNotInImageCache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadIfNotInImageCache函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LoadBasics
def LoadBasics():
"""
Loads basic images used in NSMB2
"""
# Load some coins, because coins are in almost every Mario level ever
ImageCache['Coin'] = SLib.GetImg('coin.png')
ImageCache['StarCoin'] = SLib.GetImg('starcoin.png')
# Load blocks
BlockImage = SLib.GetImg('blocks.png')
Blocks = []
count = BlockImage.width() // 24
for i in range(count):
Blocks.append(BlockImage.copy(i * 24, 0, 24, 24))
ImageCache['Blocks'] = Blocks
# Load the overrides
Overrides = QtGui.QPixmap('reggiedata/overrides.png')
Blocks = []
x = Overrides.width() // 24
y = Overrides.height() // 24
for i in range(y):
for j in range(x):
Blocks.append(Overrides.copy(j * 24, i * 24, 24, 24))
ImageCache['Overrides'] = Blocks
# Load vines, because these are used by entrances
SLib.loadIfNotInImageCache('VineTop', 'vine_top.png')
SLib.loadIfNotInImageCache('VineMid', 'vine_mid.png')
SLib.loadIfNotInImageCache('VineBtm', 'vine_btm.png')
示例2: loadImages
def loadImages():
SLib.loadIfNotInImageCache('BigPumpkin', 'giant_pumpkin.png')
SLib.loadIfNotInImageCache('ShipKey', 'ship_key.png')
SLib.loadIfNotInImageCache('5Coin', '5_coin.png')
if 'YoshiFire' not in ImageCache:
pix = QtGui.QPixmap(48, 24)
pix.fill(Qt.transparent)
paint = QtGui.QPainter(pix)
paint.drawPixmap(0, 0, ImageCache['Blocks'][9])
paint.drawPixmap(24, 0, ImageCache['Blocks'][3])
del paint
ImageCache['YoshiFire'] = pix
for power in range(0x10):
if power in (0, 8, 12, 13):
ImageCache['BigPumpkin%d' % power] = ImageCache['BigPumpkin']
continue
x, y = 36, 48
overlay = ImageCache['Blocks'][power]
if power == 9:
overlay = ImageCache['YoshiFire']
x = 24
elif power == 10:
overlay = ImageCache['5Coin']
elif power == 14:
overlay = ImageCache['ShipKey']
x, y = 34, 42
new = QtGui.QPixmap(ImageCache['BigPumpkin'])
paint = QtGui.QPainter(new)
paint.drawPixmap(x, y, overlay)
del paint
ImageCache['BigPumpkin%d' % power] = new
示例3: loadImages
def loadImages():
SLib.loadIfNotInImageCache('PipePiranhaUp', 'piranha_pipe_up.png')
示例4: loadImages
def loadImages():
SLib.loadIfNotInImageCache('NoteBlock', 'noteblock.png')