GlyphLayout有时会通过ArrayIndexOutOfBoundsException

时间:2015-08-17 05:10:37

标签: libgdx

我的游戏中有很多标签,他们使用BitmapFont来绘制。 这个例外是在我运行游戏大约20-30分钟的时候。

08-17 00:29:37.520: W/System.err(6526): java.lang.ArrayIndexOutOfBoundsException: length=127; index=-1050
08-17 00:29:37.520: W/System.err(6526):     at com.badlogic.gdx.utils.Array.pop(Array.java:294)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.utils.Pool.obtain(Pool.java:50)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.GlyphLayout.setText(GlyphLayout.java:135)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:482)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:464)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFont.draw(BitmapFont.java:198)
08-17 00:29:37.521: W/System.err(6526):     at thanbaigog.actor.BaseLabelActor.draw(BaseLabelActor.java:179)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57)
08-17 00:29:37.521: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:129)

我发现指数每减少一次

08-17 00:29:37.535: W/System.err(6526): java.lang.ArrayIndexOutOfBoundsException: length=127; index=-1052
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.utils.Array.pop(Array.java:294)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.utils.Pool.obtain(Pool.java:50)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.GlyphLayout.setText(GlyphLayout.java:135)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:482)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:464)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFont.draw(BitmapFont.java:198)
08-17 00:29:37.535: W/System.err(6526):     at thanbaigog.actor.BaseLabelActor.draw(BaseLabelActor.java:179)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57)
08-17 00:29:37.535: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:129)

08-17 00:29:37.551: W/System.err(6526): java.lang.ArrayIndexOutOfBoundsException: length=127; index=-1054
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.utils.Array.pop(Array.java:294)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.utils.Pool.obtain(Pool.java:50)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.GlyphLayout.setText(GlyphLayout.java:135)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:482)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:464)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.graphics.g2d.BitmapFont.draw(BitmapFont.java:198)
08-17 00:29:37.551: W/System.err(6526):     at thanbaigog.actor.BaseLabelActor.draw(BaseLabelActor.java:179)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:110)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:57)
08-17 00:29:37.551: W/System.err(6526):     at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:129)
08-17 00:29:37.551: W/System.err(6526):     at thanbaigog.renderer.AbstractCardRoomRenderer.render(AbstractCardRoomRenderer.java:3492)
08-17 00:29:37.551: W/System.err(6526):     at thanbaigog.renderer.TLMNCardRoomRenderer.render(TLMNCardRoomRenderer.java:1093)
08-17 00:29:37.551: W/System.err(6526):     at thanbaigog.screens.GameScreen.render(GameScreen.java:22)
08-17 00:29:37.552: W/System.err(6526):     at com.badlogic.gdx.Game.render(Game.java:46)
08-17 00:29:37.552: W/System.err(6526):     at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:422)
08-17 00:29:37.552: W/System.err(6526):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522)
08-17 00:29:37.552: W/System.err(6526):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)

0 个答案:

没有答案