本文整理汇总了Python中direct.particles.ParticleEffect.ParticleEffect.setTwoSided方法的典型用法代码示例。如果您正苦于以下问题:Python ParticleEffect.setTwoSided方法的具体用法?Python ParticleEffect.setTwoSided怎么用?Python ParticleEffect.setTwoSided使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.particles.ParticleEffect.ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.setTwoSided方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_player
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setTwoSided [as 别名]
def init_player(self, left_btn, right_btn, player_number ,pos=(0,0,0), heading=0):
color = (configs.COLORS_MAP[player_number][0])
nodePath = loadObject()
nodePath.setPos(pos)
nodePath.setScale(configs.SCALE*0.004)
nodePath.setColor(color)
p = ParticleEffect()
p.loadConfig('textures/flare.ptf')
p.start(parent = nodePath, renderParent = render)
p0 = p.getParticlesList()[0]
p0.emitter.setRadiateOrigin(Point3(0.05*cos(heading* pi/180), 0.0, 0.05*sin(heading* pi/180)))
p.setPos(0,-1,0)
# p.setBin("unsorted", 0)
# p.setDepthTest(False)
p.setTwoSided(True)
text= TextNode('text')
text.setText(str("%s" % player_number))
text.setTextColor(color)
text.setAlign(TextNode.ACenter)
# text.font = self.font
text3d = NodePath(text)
text3d.setTwoSided(True)
text3d.setPos(nodePath, -1,-3,-4)
text3d.reparentTo(render)
circle = loadObject(tex='circle.png')
circle.reparentTo(render)
circle.setPos(nodePath, 0,-2,0)
text3d.setScale(0.13)
circle.setScale(0.09)
text3d.setColorScale(color)
circle.setColorScale(color)
new_line, line_vertex, line_node = start_new_line(self, pos[0], pos[2], color)
line_id = configs.ENTITY_ID
configs.ENTITIES[configs.ENTITY_ID] = {'CATEGORY':'line', 'GEOM':new_line, 'VERTEX':line_vertex, "NODE": line_node}
configs.ENTITY_ID += 1
speed = configs.FORWARD_SPEED
right_angle = configs.FORCE_RIGHT_ANGLE_TURN
# print left_btn
# print right_btn
self.accept(("%s" % left_btn), player_controls, [configs.ENTITY_ID, 'TURN_LEFT', 1])
self.accept(("%s-up" % left_btn), player_controls, [configs.ENTITY_ID, 'TURN_LEFT', 0])
self.accept(("%s" % right_btn), player_controls, [configs.ENTITY_ID, 'TURN_RIGHT', 1])
self.accept(("%s-up" % right_btn), player_controls, [configs.ENTITY_ID, 'TURN_RIGHT', 0])
configs.ENTITIES[configs.ENTITY_ID] = {'CATEGORY':'player','ALIVE':True, 'NODE':nodePath,'PARTICLE_PARENT':p, 'PARTICLE':p0,
'HEADING':heading, 'CURRENT_LINE':line_id, 'TICKNESS':configs.SCALE, 'TURN_LEFT':0, 'TURN_RIGHT':0, 'COLOR':color,
'PLAYER_ID':text3d, 'CIRCLE_NODE':circle, 'LEFT_ARMED':True, 'RIGHT_ARMED':True, 'PLAYER_NUMBER': player_number, 'SPEED':speed,
'RIGHT_ANGLE_TURN':right_angle }
configs.ENTITY_ID += 1
示例2: __createToonInterval
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setTwoSided [as 别名]
def __createToonInterval(self, delay):
track = Sequence(Wait(delay))
sprayEffect = ParticleEffect()
sprayEffect.loadConfig('phase_5/etc/soundWave.ptf')
sprayEffect.setDepthWrite(0)
sprayEffect.setDepthTest(0)
sprayEffect.setTwoSided(1)
I1 = 2.8
track.append(ActorInterval(self.avatar, 'sound', playRate=1.0, startTime=0.0, endTime=I1))
track.append(Func(self.setPosFromOther, sprayEffect, self.gag, Point3(0, 1.6, -0.18)))
track.append(self.__getPartTrack(sprayEffect, 0.0, 6.0, [sprayEffect, self.avatar, 0], softStop=-3.5))
track.append(ActorInterval(self.avatar, 'sound', playRate=1.0, startTime=I1))
return track
示例3: damageCogsNearby
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import setTwoSided [as 别名]
def damageCogsNearby(self, radius = None):
if not radius:
radius = self.soundRange
suits = []
for obj in base.cr.doId2do.values():
if obj.__class__.__name__ == 'DistributedSuit':
if obj.getPlace() == base.localAvatar.zoneId:
if obj.getDistance(self.avatar) <= radius:
if self.avatar.doId == base.localAvatar.doId:
suits.append(obj)
def shouldContinue(suit, track):
if suit.isDead():
track.finish()
for suit in suits:
if self.name != CIGlobals.Opera:
self.avatar.sendUpdate('suitHitByPie', [suit.doId, self.getID()])
else:
breakEffect = ParticleEffect()
breakEffect.loadConfig('phase_5/etc/soundBreak.ptf')
breakEffect.setDepthWrite(0)
breakEffect.setDepthTest(0)
breakEffect.setTwoSided(1)
suitTrack = Sequence()
if suit.isDead():
return
suitTrack.append(Wait(2.5))
delayTime = random.random()
suitTrack.append(Wait(delayTime + 2.0))
suitTrack.append(Func(shouldContinue, suit, suitTrack))
suitTrack.append(Func(self.setPosFromOther, breakEffect, suit, Point3(0, 0, 0)))
suitTrack.append(SoundInterval(self.hitSfx, node=suit))
suitTrack.append(Func(self.avatar.sendUpdate, 'suitHitByPie', [suit.doId, self.getID()]))
suitTrack.start()
suits = None
return