【问题标题】:Android Studio Loading Texture errorAndroid Studio 加载纹理错误
【发布时间】:2016-07-24 15:22:39
【问题描述】:

我有一个奇怪的错误,我无法再加载任何纹理。我使用的资产很好,但是当我尝试添加新资产时,它会抛出这个:

E/AndroidRuntime: FATAL EXCEPTION: GLThread 9855
Process: com.NeverMind.MainClass.android, PID: 18482
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: bg.png
     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
     at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
     at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200)
     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
Caused by: java.io.IOException: Error loading pixmap: decoder init failed for stream
     at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:57)
     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:138)
     at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98) 
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100) 
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92) 
     at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200) 
     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241) 
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520) 
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248) 

I didn't do anything stupid. I also tried to trick him and put the new texture with the name of an old one and it didn't work. This is the first time this happens, I have thousands of lines in the code. 

【问题讨论】:

标签: java android libgdx textures


【解决方案1】:

问题在于位深度。它需要更小。

【讨论】:

    猜你喜欢
    • 2012-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-25
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    相关资源
    最近更新 更多