LibGDX: Particle scale

后端 未结 5 835
不知归路
不知归路 2021-01-13 08:40

In my game I use

static final float FRUSTUM_WIDTH = 10;
 static final float FRUSTUM_HEIGHT = 15;   

So when I draw the particles they take

5条回答
  •  Happy的楠姐
    2021-01-13 09:20

    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);
    

提交回复
热议问题