How to set libgdx resources folder without creating android project?

Is there any way to do this?

I can not find the tutorial related to it in google.

+6
source share
2 answers

Libgdx does not use any specific hierarchy or folder naming conventions to store your assets in such a way that Gdx.files.internal("myassets/libgdx.png") works perfectly on the desktop. However, Android projects have a specific folder in the root name. The folder should be strictly called "assets", as provided by the Android project [ 1 ]. Therefore, it would be better to lay out the folder hierarchy in the same way in other projects so that you do not have to make changes for individual platforms. A much better approach would be to simply place your resources in an Android project and link them to other projects. This will allow you to update your resources in only one project, and this will be reflected everywhere. This is explained in detail here .

And as an informative note, start using AssetManager for asset management for your Libgdx project, as this will greatly simplify asset management.

+4
source

You really don't have to do anything. You can use any folder in the root directory of the Desktop project. For instance:

 texture = new Texture(Gdx.files.internal("myfolder/libgdx.png")); 
+6
source

All Articles