Daniel Roca Lopez
Daniel Roca Lopez

Reputation: 574

when to use gdx.files.internal and when relative path?

I've seen many examples of both cases, for example:

atlas = new TextureAtlas("skins/userInterface.pack");
white = new BitmapFont(Gdx.files.internal("font/white.fnt"));

I've seen that on a tutorial but, it also works that way:

atlas = new TextureAtlas(Gdx.files.internal("skins/userInterface.pack"));
white = new BitmapFont("font/white.fnt");

when should I use Gdx.files.internal or directly the relative path from assets folder?

Upvotes: 3

Views: 583

Answers (1)

noone
noone

Reputation: 19796

It is exactly the same. When using a String parameter, the constructor uses Gdx.files.internal to resolve the file, just as you would do it yourself.

You can see this here for example in case of the TextureAtlas.

Upvotes: 3

Related Questions