0
votes

I am using particle effect in libgdx. When I load file using Gdx.files.internal command it shows exception like this com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\image.p (Internal), my code is given below...

ParticleEffect effect;

effect = new ParticleEffect();
    effect.load(Gdx.files.internal("data/image.p"), Gdx.files.internal("data"));

I am using Particle Editor tool for making effect and save the effect using save button given in the tool.I think there is problem of making particleEffect.p file.Help me...???

3

3 Answers

4
votes
 effect.load(Gdx.files.internal("data/image.p"), Gdx.files.internal("data"));

your image.p should be in the data folder of your libgdx project the image you used in making should also be there in data folder because the second argument in the load function is the directory where your image is present.

The exception you are getting is fileNotFound. Libgdx in not finding your file.. May be you have not put your files in the correct path.

1
votes

1) Edit your "image.p" in eclipse

2) Replace the 2 lines (at the end of the file) :

 - Image Path -
pre_particle.png (or particle.png)

by

pre_particle.png (or particle.png)

this line MUST be the last line of the file

3) save your file ;) and it should work

0
votes

i think you have to give the path of the image from which you have created the .p file do one thing in your.p file at the end do this - Image Path - particle.png

and save the image in your assests/data folder it worked fine for meee