IParticle 粒子类 Particles


构造函数 Constructor

构造函数 Constructor说明 Description 备注 Note
IParticle(bitmaps, num,time,type,viewport)

bitmaps(array) 单个粒子位图 bitmap of single particle

num(Number) 粒子数量 Number of particles

time(Number) 粒子衰弱时间 duration of particles

type(Number) 粒子类型,0为区域发射,1为点发射 particle type, 0 is area emission, 1 is point emission

viewport(IViewport) 粒子所在视窗,可缺省 the viewport which the particle in(It can be default)

属性 Attribute

属性 Attribute说明 Description 备注 Note
line(Number) 发射距离 Launching distance type = 0 有效 valid
dir(Number) 发射方向 0上 1下 2左 3右 4左上 5右上 6左下 7右下 0 up 1 down 2 left 3 right 4 upper left 5 upper right 6 lower left 7 lower right type = 0 有效 valid
rect(Number) 发射范围 Launch range type = 0 有效 valid
radii(Number) 反射半径 Launch radius type = 1 有效 valid
x(Number) 发射点x Launch point x type = 1 有效 valid
y(Number) 发射点y Launch point y type = 1 有效 valid
z(Number) 粒子所在图层 Layer of particles

函数 Function

函数 Function说明 Description 备注 Note
changeParticle(bitmaps,num, time, type, viewport)

更改粒子动画 Change particle animation

bitmaps(array) 单个粒子位图 bitmap of single particle

num(Number) 粒子数量 Number of particles

time(Number) 粒子衰弱时间 duration of particles

type(Number) 粒子类型,0为区域发射,1为点发射 particle type, 0 is area emission, 1 is point emission

viewport(IViewport) 粒子所在视窗,可缺省 the viewport which the particle in(It can be default)

dispose() 释放粒子动画 Free up particle animation
play() 播放一次粒子动画 Play animation once 可不用放在状态机中循环播放 This function does not need to be executed in the state machine
update() 循环播放粒子动画 Loop animation 需要放在场景状态机中执行 This function will work in state machine