egret之粒子系统

1.添加粒子库,放在项目同级目录下(必须!!必须!!)

2.添加路径:

3.添加代码:

    private creatParticle(_pname: string, _target, _x: number, _y: number) {
        if (_target != null) {
            let texture = RES.getRes(_pname + "_png");
            let config = RES.getRes(_pname + "_json");
   
            var _particle = new particle.GravityParticleSystem(texture, config);
            _particle.touchEnabled = false;
            _target.addChild(_particle);

            _particle.x = _x;
            _particle.y = _y;
            _particle.start()
            return _particle;
        } else {
            console.log("装载容器不存在");
        }
    }
原文地址:https://www.cnblogs.com/shirln/p/9700681.html