简体   繁体   English

为什么“没有com.badlogic.gdx.scenes.scene2d.ui.ScrollPane $ ScrollPaneStyle注册名称:默认”错误即将到来以及如何解决?

[英]Why “No com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle registered with name: default” error is coming and how to fix it?

When I am compiling LibGdx project I am getting the below exception. 当我编译LibGdx项目时,我得到以下异常。

My question here is why it is coming and how to resolve this? 我的问题是它为什么要来,以及如何解决这个问题?

Libgdx: 0.9.9 Libgdx:0.9.9

com.badlogic.gdx.utils.GdxRuntimeException: No com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle registered with name: default

Json File Json文件

{
com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } },
com.badlogic.gdx.graphics.Color: {
    green: { a: 1, b: 0, g: 1, r: 0 },
    white: { a: 1, b: 1, g: 1, r: 1 },
    red: { a: 1, b: 0, g: 0, r: 1 },
    black: { a: 1, b: 0, g: 0, r: 0 }
},
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
    dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } }
},
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
    default: { down: default-round-down, up: default-round },
    toggle: { down: default-round-down, checked: default-round-down, up: default-round }
},
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
    default: { down: default-round-down, up: default-round, font: default-font, fontColor: white },
    toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red }
},
com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
    default: { font: default-font, fontColor: white, background: default-select, scrollStyle: default, listStyle: { font: default-font, selection: default-select-selection } }
},
com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
    default-vertical: { handle: default-splitpane-vertical },
    default-horizontal: { handle: default-splitpane }
},
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
    default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
    default: { titleFont: default-font, background: default-window, titleFontColor: white },
    dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim }
},
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
    default-horizontal: { background: default-slider, knob: default-slider-knob }
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
    default: { font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
    default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor }
},
com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
    default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
    default: { fontColorUnselected: white, selection: default-rect-pad, fontColorSelected: white, font: default-font }
},
com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: {
    default: { background: default-pane, knob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: {
    default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection }
}
}

Update: I have updated my projects libgdx to latest(nightly build) and now I am getting different exception [com.badlogic.gdx.utils.GdxRuntimeException: Invalid line: ] and the exception detail is below. 更新:我已将我的项目libgdx更新为最新版(每晚构建版),现在我得到了不同的异常[com.badlogic.gdx.utils.GdxRuntimeException:无效的行:],下面是异常详细信息。

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Error reading pack file: images/uiskin.atlas
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:178)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:222)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:217)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:207)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:202)
    at com.pactpub.libgdx.canyonbunny.screens.MenuScreen.rebuildStage(MenuScreen.java:72)
    at com.pactpub.libgdx.canyonbunny.screens.MenuScreen.show(MenuScreen.java:348)
    at com.badlogic.gdx.Game.setScreen(Game.java:61)
    at com.pactpub.libgdx.canyonbunny.CanyonBunnyMain.create(CanyonBunnyMain.java:15)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Invalid line: <html class="   ">
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.readValue(TextureAtlas.java:426)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:111)

Taken from the latest uiskin.json from the tests. 取自最新的uiskin.json测试。

com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large } }, com.badlogic.gdx.scenes.scene2d.ui.ScrollPane $ ScrollPaneStyle:{default:{vScroll:default-scroll,hScrollKnob:default-round-large,background:default-rect,hScroll:default-scroll,vScrollKnob:default- round-large}},

Try to insert this in your uiskin.json and it might work. 尝试在你的uiskin.json中插入它,它可能会工作。 There have been several changes to the ScrollPane though and it might not work anymore with the old 0.9.9. 虽然对ScrollPane进行了一些更改,但它可能不再适用于旧的0.9.9。 You should consider using the latest version libgdx (nightly build). 您应该考虑使用最新版本的libgdx(每晚构建)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 libgdx无法拖动com.badlogic.gdx.scenes.scene2d.ui.Window - libgdx can't drag com.badlogic.gdx.scenes.scene2d.ui.Window 如何修复java.lang.UnsatisfiedLinkError:com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()? - How to fix java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()? “错误:(3,24)java:包com.badlogic.gdx不存在”,如何解决此问题? - “Error:(3, 24) java: package com.badlogic.gdx does not exist”, How to fix this? Libgdx scene2d uiskin.json com.badlogic.gdx.utils.GdxRuntimeException - Libgdx scene2d uiskin.json com.badlogic.gdx.utils.GdxRuntimeException 崩溃:com.badlogic.gdx.physics.box2d.World.jniCreateBody - CRASH: com.badlogic.gdx.physics.box2d.World.jniCreateBody LIBGDX Getting this error com.badlogic.gdx.utils.SerializationException: Error reading file: ui/uiskin.json ON ANDROID ONLY - LIBGDX Getting this error com.badlogic.gdx.utils.SerializationException: Error reading file: ui/uiskin.json ON ANDROID ONLY NoClassDefFoundError:com / badlogic / gdx / LifecycleListener - NoClassDefFoundError: com/badlogic/gdx/LifecycleListener 错误:包 com.badlogic.gdx.backends.lwjgl 不存在 - error: package com.badlogic.gdx.backends.lwjgl does not exist com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件:-错误 - com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: - Error libGDX GWT编译错误似乎与com.badlogic.gdx.utils.AtomicQueue有关<T> - libGDX GWT compile error that appears to be related to com.badlogic.gdx.utils.AtomicQueue<T>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM