๐ป Programming
libGdx ํ๋ก์ ํธ ์์ฑ ์งํ ๋ฐ์คํฌํ์ผ๋ก ํ ์คํ ํ ๋ ์ค๋ฅ ํด๊ฒฐ๋ฐฉ๋ฒ
libGdx ํ๋ก์ ํธ ์์ฑ ์งํ ๊ธฐ๋ณธ์ ์ผ๋ก ์๋๋ก์ด๋ ๋ฒ์ ์ ํ ์คํ ์ด ์ํํ ์งํ์ด ๋๋ค.
ํ์ง๋ง ๋ฐ์คํฌํ ๋ฒ์ ์ผ๋ก ํ ์คํ ํ๋ ค๊ณ ํ๋ฉด ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: badlogic.jpg
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.badlogic.gdx.graphics.Texture.<init>(Texture.java:88)
at com.mygdx.game.MyGdxGame.create(MyGdxGame.java:18)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:143)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: badlogic.jpg (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
... 7 more
Process finished with exit code 0
ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์๋์ ๊ฐ๋ค.
1. ์ดํด๋ฆฝ์ค ์ฌ์ฉ์์ ๊ฒฝ์ฐ
Run => Run Configurations.. => DesktopLauncher ์ Arguments ํญ => Working Directory => Others then browse to yourproject-android/assets/ and click Apply => Run
2. ์๋๋ก์ด๋ ์คํ๋์ค์ ๊ฒฝ์ฐ
-
Run -> Edit Configurations
-
"Working Directory:" ๋ฅผ ๊ฐ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก ์๋๋ก์ด๋ ์คํ๋์ค ํ๋ก์ ํธ ์ต์์ ๋๋ ํ ๋ฆฌ๋ก ์ค์ ๋์ด์๋๋ฐ => "android/assets" ๋๋ ํ ๋ฆฌ๊น์ง ๋ค์ด๊ฐ๋๋ก ์ค์
์ด์ ๋ค์ ์คํํด๋ณด์๋ฉด ์ ๋ ๊ฒ๋๋ค.
์ฆํ~