android – libgdx particleEffect旋转

前端之家收集整理的这篇文章主要介绍了android – libgdx particleEffect旋转前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我用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);
原文链接:https://www.f2er.com/android/309012.html

猜你在找的Android相关文章