在我的游戏中我使用
static final float FRUSTUM_WIDTH = 10;
static final float FRUSTUM_HEIGHT = 15;
所以当我绘制粒子时,它们会占据整个屏幕并且非常大!那么我该如何缩小它们以满足我的需求呢?
//皮尤实验室
最佳答案
ParticleEffect pe = new ParticleEffect();
pe.load(Gdx.files.internal("data/particle/particle.p"), Gdx.files.internal("data/particle"));
pe.setPosition(x, y);
float pScale = 0.2f;
float scaling = pe.getEmitters().get(0).getScale().getHighMax();
pe.getEmitters().get(0).getScale().setHigh(scaling * pScale);
scaling = pe.getEmitters().get(0).getScale().getLowMax();
pe.getEmitters().get(0).getScale().setLow(scaling * pScale);
scaling = pe.getEmitters().get(0).getVelocity().getHighMax();
pe.getEmitters().get(0).getVelocity().setHigh(scaling * pScale);
scaling = pe.getEmitters().get(0).getVelocity().getLowMax();
pe.getEmitters().get(0).getVelocity().setLow(scaling * pScale);
关于java - LibGDX:粒子尺度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9708490/