2011-08-05 5 views

답변

0

상태를 저장하여 절약 의미 및로드 설정/환경 설정, this 사용하는 경우 : 바위가 bottm 상단에서 떨어지는 경우, 예를 들어, 의미에서 상태를 저장

Preferences prefs = Gdx.app.getPreferences("my-preferences"); 
prefs.putBoolean("bool", true); 
prefs.putInteger("int", 1234); 
prefs.putLong("long", Long.MAX_VALUE); 
prefs.putFloat("float", 1.2345f); 
prefs.putString("string", "test!"); 

if(prefs.getBoolean("bool") != true) throw new GdxRuntimeException("bool failed"); 
if(prefs.getInteger("int") != 1234) throw new GdxRuntimeException("int failed"); 
if(prefs.getLong("long") != Long.MAX_VALUE) throw new GdxRuntimeException("long failed"); 
if(prefs.getFloat("float") != 1.2345f) throw new GdxRuntimeException("float failed"); 
if(!prefs.getString("string").equals("test!")) throw new GdxRuntimeException("string failed"); 
+0

을하고 난 대체한다 그것은 그것이 떨어진 곳으로 돌아 간다. 이 시나리오에서는 도움이 필요합니다. – pradeepkalla