本文整理汇总了Python中Pixie.createBG方法的典型用法代码示例。如果您正苦于以下问题:Python Pixie.createBG方法的具体用法?Python Pixie.createBG怎么用?Python Pixie.createBG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pixie
的用法示例。
在下文中一共展示了Pixie.createBG方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __createTrailParticlesIfNeeded
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def __createTrailParticlesIfNeeded(self, node, iTrack, effectGroup, effectIndex, drawOrder, isActiveNode):
if effectIndex is None:
return
else:
effectDesc = self.__vehicle.typeDescriptor.chassis['effects'].get(effectGroup)
if effectDesc is None:
return
effectName = effectDesc[0].get(effectIndex)
if effectName is None or effectName == 'none' or effectName == 'None':
return
if isinstance(effectName, list):
effectIdx = iTrack
effectIdx += 0 if isActiveNode else 2
effectName = effectName[effectIdx]
nodeEffects = self.__trailParticles.get(node)
if nodeEffects is None:
nodeEffects = []
self.__trailParticles[node] = nodeEffects
else:
for nodeEffect in nodeEffects:
createdForActiveNode = nodeEffect[5]
if nodeEffect[1] == effectIndex and createdForActiveNode == isActiveNode:
return
elemDesc = [drawOrder,
node,
effectName,
effectIndex,
isActiveNode,
nodeEffects]
Pixie.createBG(effectName, partial(self._callbackTrailParticleLoaded, elemDesc))
return
示例2: create
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def create(self, model, list, args):
elem = {}
elem['newPos'] = args.get('position', None)
nodePos = self._pos
if elem['newPos'] is not None:
nodePos = string.split(elem['newPos'][0], '/') if elem['newPos'][0] else []
scale = args.get('scale')
if scale is not None:
elem['scale'] = scale
elem['surfaceNormal'] = args.get('surfaceNormal', None)
surfaceMatKind = args.get('surfaceMatKind', None)
if surfaceMatKind is not None and self._surfaceMatKinds is not None:
if surfaceMatKind not in self._surfaceMatKinds:
return
elem['node'] = _findTargetNode(model, nodePos, elem['newPos'][1] if elem['newPos'] else None, self._orientByClosestSurfaceNormal, elem['surfaceNormal'])
elem['model'] = model
elem['typeDesc'] = self
elem['pixie'] = None
elem['cancelLoadCallback'] = False
elem['callbackID'] = None
if self._havokFiles is None:
file = random.choice(self._files)
else:
file, fileToClear = random.choice(zip(self._files, self._havokFiles))
if args.get('havokEnabled', False):
file, fileToClear = fileToClear, file
self.__prototypePixies.pop(fileToClear, None)
prototypePixie = self.__prototypePixies.get(file)
if prototypePixie is not None:
elem['pixie'] = prototypePixie.clone()
self._callbackCreate(elem)
else:
elem['file'] = file
Pixie.createBG(file, partial(self._callbackAfterLoading, elem))
list.append(elem)
示例3: create
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def create(self, model, list, args):
elem = {}
elem['newPos'] = args.get('position', None)
nodePos = self._pos
if elem['newPos'] is not None:
nodePos = string.split(elem['newPos'][0], '/') if elem['newPos'][0] else []
scale = args.get('scale')
if scale is not None:
elem['scale'] = scale
elem['surfaceNormal'] = args.get('surfaceNormal', None)
surfaceMatKind = args.get('surfaceMatKind', None)
if surfaceMatKind is not None and self._surfaceMatKinds is not None:
if surfaceMatKind not in self._surfaceMatKinds:
return
elem['node'] = _findTargetNode(model, nodePos, elem['newPos'][1] if elem['newPos'] else None, self._orientByClosestSurfaceNormal, elem['surfaceNormal'])
elem['model'] = model
elem['typeDesc'] = self
elem['pixie'] = None
elem['cancelLoadCallback'] = False
elem['callbackID'] = None
if self._alwaysUpdate:
BigWorld.addAlwaysUpdateModel(model)
file = random.choice(self._files)
prototypePixie = self.__prototypePixies.get(file)
if prototypePixie is not None:
elem['pixie'] = prototypePixie.clone()
elem['callbackID'] = BigWorld.callback(0.001, partial(self._callbackCreate, elem))
else:
elem['file'] = file
Pixie.createBG(file, partial(self._callbackAfterLoading, elem))
list.append(elem)
return
示例4: __init__
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def __init__(self, name, onLoadCallback, pixie = None):
if pixie is None:
self.__loader = stricted_loading.restrictBySpace(self.__onLoad)
self.__callback = onLoadCallback
else:
self.__loader = None
self.__callback = None
self.name = name
self.pixie = pixie
Pixie.createBG(name, self.__loader)
return
示例5: __update
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def __update(self):
self.__cbID = None
visibility = self.__motor.warplaneAlpha
if self.__sound is not None and self.__sound.isPlaying:
self.__sound.volume = visibility
if visibility == 1.0 and not self.__fadedIn:
self.__fadedIn = True
ds = self.__curve.getChannelProperty(0, 'effectName')
effectName = ds.asString if ds is not None else ''
if effectName != '':
Pixie.createBG(effectName, self.__onParticlesLoaded)
elif visibility <= 0.1 and self.__fadedIn:
self.stop()
return
self.__cbID = BigWorld.callback(0, self.__update)
return
示例6: getPixie
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def getPixie(name, onLoadCallback):
pixieInfo = PixieCache.pixieCache.get(name, (None, set()))
if pixieInfo[0] is None:
cbksSize = len(pixieInfo[1])
pixieInfo[1].add(onLoadCallback)
if cbksSize == 0:
Pixie.createBG(name, partial(PixieCache.onPixieLoaded, name))
PixieCache.pixieCache[name] = pixieInfo
return
else:
if len(pixieInfo) == 1:
newPixie = pixieInfo[0].clone()
else:
newPixie = pixieInfo.pop()
return newPixie
return
示例7: __update
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def __update(self):
self.__cbID = None
visibility = self.__motor.warplaneAlpha
if visibility == 1.0 and not self.__fadedIn:
self.__fadedIn = True
ds = self.__curve.getChannelProperty(0, 'effectName')
effectName = ds.asString if ds is not None else ''
if effectName != '':
Pixie.createBG(effectName, partial(self.__onParticlesLoaded, effectName))
elif visibility <= 0.1 and self.__fadedIn or Timer.getTime() > self.__endTime:
self.pause()
return
if self.__sound is not None:
if self.__sound.isPlaying:
self.__sound.volume = visibility
else:
self.__playSound()
self.__cbID = BigWorld.callback(0.25, self.__update)
示例8: __init__
# 需要导入模块: import Pixie [as 别名]
# 或者: from Pixie import createBG [as 别名]
def __init__(self, exhaustEffectsDescriptor, drawOrder, uniqueEffects=None):
if uniqueEffects is None:
self.__uniqueEffects = {}
else:
self.__uniqueEffects = {name: effect.clone() for name, effect in uniqueEffects.iteritems()}
self.__tables = []
self.__maxDrawOrder = drawOrder - 1
self.__node = None
for rangeTable in exhaustEffectsDescriptor.tables:
effectsValues = []
for name in rangeTable.values:
effect = self.__uniqueEffects.get(name)
if effect is None:
elemDesc = [name, effectsValues]
Pixie.createBG(name, partial(self._callbackExhaustPixieLoaded, elemDesc))
else:
effectsValues.append(effect)
self.__tables.append(RangeTable(rangeTable.keys, effectsValues))
if self.__maxDrawOrder < drawOrder:
self.__maxDrawOrder = drawOrder
self.__activeEffect = None