LibGDX:没有可绘制、NinePatch、TextureRegion、Texture或Sprite注册名称:white
我使用LibGDX:没有可绘制、NinePatch、TextureRegion、Texture或Sprite注册名称:white,libgdx,skin,Libgdx,Skin,我使用uiskin.json作为我的游戏皮肤。但我总是得到一个错误,没有可绘制、NinePatch、TextureRegion、Texture或Sprite注册名为:white。我在网上搜索,但没有找到合适的解决方案。也许我的档案有问题 { com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, com.badlogic.gdx.graphics.Color: { green:
uiskin.json
作为我的游戏皮肤。但我总是得到一个错误,没有可绘制、NinePatch、TextureRegion、Texture或Sprite注册名为:white
。我在网上搜索,但没有找到合适的解决方案。也许我的档案有问题
{
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.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.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.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 }
}
}
我是这样使用皮肤的(如果这有什么关系的话):
呃,我一直在强迫你留下错误,并通过编辑uisking.atlas获得它 看,文件中有白色,或者再次下载文件 阿特拉斯国王酒店
..//
selection
rotate: false
xy: 170, 44
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
white
rotate: false
xy: 174, 48
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
您可能没有在Atlas文件中定义白色我认为您的json是正确的,您的资产文件夹中有uiskin.json、uiskin.Atlas和字体,我的文件夹中有uiskin.Atlas、uiskin.png、default.fnt、default.json、default.png和uiskin.json。如果json是正确的,我的错误是从哪里来的?我从来没有发生过,我只需要这些文件,但在这个方向上,通过复制所有文件来排序,所以我必须下载所有这些文件?难道不能再指定一点所需的文件吗?不,你不需要所有这些文件。发布您的uiskin.atlas文件。它需要定义一些称为
white
的纹理区域。
..//
selection
rotate: false
xy: 170, 44
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
white
rotate: false
xy: 174, 48
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1