使用Egret土特産Egret Feather粒子編輯器 。 導出流星粒子特效如下如下:
導出2個檔案 :一 , 準備工作 :加入粒子子產品 , 粒子系統在第三方庫裡面。是以需要下載下傳第三方庫加入到項目裡面
①:下載下傳第三方庫
②:加入到項目(這裡我隻是将庫放在與項目平級的目錄裡面,而且我隻是取出了) ③:在egretProperties.json的配置 ④:使用egret build -e指令 關于粒子核心module app {
export class ParticleView extends eui.Component implements eui.UIComponent{
private particleSys : particle.GravityParticleSystem;
public constructor() {
super();
this.skinName = "resource/eui_skins/ParticleE.exml";
}
protected partAdded(partName : string , instance : any):void{
super.partAdded(partName , instance);
}
protected childrenCreated():void{
super.childrenCreated();
this.startSyncLoadLizi();
}
private startSyncLoadLizi() : void{
this.syncLoadLizi("plizi_json");
}
private syncLoadLizi( resName : string ) : void{
var self = this;
RES.getResAsync(resName,
function(data: any,key: string): void {
if(key == "plizi_json") {
self.syncLoadLizi("plizi_png");
}
else if(key == "plizi_png") {
this.initParticle();
}
},
this);
}
/**
* 初始化例子系統
*/
private initParticle() : void{
var texture = RES.getRes("plizi_png");
var config = RES.getRes("plizi_json");
this.particleSys = new particle.GravityParticleSystem(texture, config);
this.addChild( this.particleSys );
this.particleSys.start();
}
}
}
核心::::
var texture = RES.getRes("plizi_png");
var config = RES.getRes("plizi_json");
this.particleSys = new particle.GravityParticleSystem(texture, config);
this.addChild( this.particleSys );
this.particleSys.start();
效果: