Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 找不到Libgdx file.internal文件错误_Java_Libgdx - Fatal编程技术网

Java 找不到Libgdx file.internal文件错误

Java 找不到Libgdx file.internal文件错误,java,libgdx,Java,Libgdx,我需要在我的项目中使用atlas文件。 但是libgdx只是给了我一个file not found错误,即使我在assets文件夹中已经有了atlas 下面是代码: 编辑:链接到我的项目github repo: 链接到资产文件夹: 错误代码: 多亏了IRC的人,我的错误是将Gdx.files.internal与变量一起使用,而不是使用Gdx.files.local 我真傻。这信息还不够。发布异常,平台。使用简单文件(如.png)进行测试,以查看项目是否正确设置。这是桌面项目吗?您在运行

我需要在我的项目中使用atlas文件。 但是libgdx只是给了我一个file not found错误,即使我在assets文件夹中已经有了atlas

下面是代码:

编辑:链接到我的项目github repo:

链接到资产文件夹:

错误代码:
多亏了IRC的人,我的错误是将Gdx.files.internal与变量一起使用,而不是使用Gdx.files.local


我真傻。

这信息还不够。发布异常,平台。使用简单文件(如.png)进行测试,以查看项目是否正确设置。这是桌面项目吗?您在运行配置中将工作目录设置为assets了吗?@PiotrJ很奇怪,甚至在简单的PNG中也会出现错误。@Tenfour04这是gui安装向导中的默认项目。我的意思是,它是项目的桌面模块吗?还是安卓?
  LoadAtlas.addListener(new InputListener()
            {
                @Override
                 public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
                    character.AddAnimation(AtlasName.getText());
                    return true;
            }
            });
public void AddAnimation(String s)
    {
        chara_atlas.AddAnimation(s);
    }
public void AddAnimation(String name)
    {
        if (Gdx.files.internal(name).exists())
        {
        TextureAtlas tmp = new TextureAtlas(Gdx.files.internal(name));
        texture_atlases.add(tmp);
        animations.add(new Animation(1/15f, texture_atlases.get(texture_atlases.size()-1).getRegions()));
        }
        else
        {
            Gdx.app.log("File", "File Not found " + name);
        }
    }