I get an error every time I try to parse this .json file.
Here is the error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.SerializationException: Error reading file: skin/glassy-ui.json
at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:104)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:81)
at com.mygdx.game.MyGdxGame.create(MyGdxGame.java:45)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: com.badlogic.gdx.utils.SerializationException: Error reading file: skin/glassy-ui.json
at com.badlogic.gdx.utils.Json.fromJson(Json.java:715)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:102)
... 4 more
Caused by: com.badlogic.gdx.utils.SerializationException: Error parsing file: skin/glassy-ui.json
at com.badlogic.gdx.utils.JsonReader.parse(JsonReader.java:78)
at com.badlogic.gdx.utils.Json.fromJson(Json.java:713)
... 5 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: skin\glassy-ui.json (Classpath)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:142)
at com.badlogic.gdx.files.FileHandle.reader(FileHandle.java:169)
at com.badlogic.gdx.utils.JsonReader.parse(JsonReader.java:76)
... 6 more
Here is the code:
mySkin = new Skin(Gdx.files.classpath(constants.skin));
I have my references correct and the assets are properly placed in the folder. I'm not sure why it is saying file not found: skin/glassy-ui.json
json code:
{
com.badlogic.gdx.graphics.g2d.BitmapFont: {
font: {
file: font-export.fnt
}
font-big: {
file: font-big-export.fnt
}
}
com.badlogic.gdx.graphics.Color: {
black: {
r: 0
g: 0
b: 0
a: 1
}
cyan: {
r: 0
g: 1
b: 0.99166656
a: 1
}
dark-cyan: {
r: 0
g: 0.39373153
b: 0.4333333
a: 1
}
white: {
r: 1
g: 1
b: 1
a: 1
}
}
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
pale-blue: {
name: white
color: {
r: 0.48342222
g: 0.76367503
b: 0.99333334
a: 1
}
}
black: {
name: white
color: {
r: 0
g: 0
b: 0
a: 1
}
}
}
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: {
up: button
down: button-down
}
small: {
up: button-small
down: button-small-down
}
}
com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
default: {
checkboxOn: checkbox
checkboxOff: checkbox-off
font: font
fontColor: white
}
radio: {
checkboxOn: radio-button
checkboxOff: radio-button-off
font: font
fontColor: white
}
}
com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: {
default: {
up: button
down: button-down
}
}
com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: {
default: {
font: font-big
up: button
down: button-down
}
}
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: {
font: font
}
big: {
font: font-big
}
black: {
font: font
fontColor: black
}
}
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
default: {
font: font
fontColorSelected: white
fontColorUnselected: dark-cyan
selection: pale-blue
background: list
}
plain: {
font: font
fontColorSelected: white
fontColorUnselected: dark-cyan
selection: pale-blue
}
}
com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: {
default-horizontal: {
background: progress-bar
knobBefore: progress-bar-knob
}
default-vertical: {
background: progress-bar-vertical
knobBefore: progress-bar-knob-vertical
}
}
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
default: {
hScroll: horizontal-scroll-bar
hScrollKnob: horizontal-scroll-knob
vScroll: vertical-scroll-bar
vScrollKnob: vertical-scroll-knob
}
scroll: {
background: list
hScroll: horizontal-scroll-bar
hScrollKnob: horizontal-scroll-knob
vScroll: vertical-scroll-bar
vScrollKnob: vertical-scroll-knob
}
}
com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
default: {
font: font
fontColor: dark-cyan
background: select-box
scrollStyle: scroll
listStyle: plain
}
}
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
default-horizontal: {
background: slider
knob: slider-knob
}
default-vertical: {
background: slider-vertical
knob: slider-knob
}
}
com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
default-horizontal: {
handle: horizontal-split-pane
}
default-vertical: {
handle: vertical-split-pane
}
}
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
default: {
font: font-big
up: button
down: button-down
}
small: {
font: font
up: button-small
down: button-small-down
}
}
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
default: {
font: font
fontColor: black
background: textfield
cursor: black
selection: pale-blue
}
}
com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: {
default: {
plus: plus
minus: minus
selection: pale-blue
}
}
com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
default: {
background: window
titleFont: font
titleFontColor: black
}
}
}