我用libgdx在我的
android设备上画火:
ParticleEffect effect; ParticleEffectPool fireEffectPool; Array<PooledEffect> effects = new Array<PooledEffect>(); @Override public void create() { ... effect = new ParticleEffect(); effect.load(Gdx.files.internal("particles/fire01.p"),Gdx.files.internal("image")); effect.setFlip(true,false); fireEffectPool = new ParticleEffectPool(effect,1000,3000); PooledEffect myEffect = fireEffectPool.obtain(); myEffect.setPosition(200,400); effects.add(myEffect); ... }
我可以通过编程方式旋转,设置速度或缩放效果吗?
解决方法
是.查看ParticleEmitterTest:
https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/ParticleEmitterTest.java
你只需要获得一个ParticleEmitter:
emitter = effect.getEmitters().first(); emitter.getScale().setHigh(5,20);