0
我想爲我的項目在Libgdx中創建一個本地化文件;不過,我的代碼正在拋出一個錯誤。Libgdx本地化
我的代碼:
package com.mygdx.mytest;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.utils.I18NBundle;
import java.util.Locale;
public class MyTest extends ApplicationAdapter {
@Override
public void create() {
FileHandle baseFileHandle = Gdx.files.internal("i18n/MyBundle");
Locale locale =new Locale("", "", "");
I18NBundle MyBundle = I18NBundle.createBundle(baseFileHandle, locale);
}
@Override
public void render() {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
}
}
我的錯誤:
I18NBundle MyBundle = I18NBundle.createBundle(baseFileHandle, locale);
哪裏是我的錯?請幫忙。
謝謝,是的,我的錯誤,你是對的 –