セット画像を読み込むためのクラスを追加します。
public class Game extends BaseGameActivity {
private Scene dScene;
private TextureRegion dLoadingRegion;
Handler dHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case 0:
setYourSceneData();
break;
}
};
};
@Override
public Engine onLoadEngine() {
return null;
}
public void onLoadResources() {
BitmapTextureAtlas BitmapTextureAtlas = new BitmapTextureAtlas(512,
512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
dLoadingRegion = BitmapTextureAtlasTextureRegionFactory
.createFromAsset(BitmapTextureAtlas, this,
"your loading image path", 0, 0);
getTextureManager().loadTextures(BitmapTextureAtlas);
}
private void loadOtherGameGraphics() {
// here load your other region
for(i=0;i<100;i++)
{
textCircle[i]=new Texture(1024,512,TextureOptions.BILINEAR_PREMULTIPLYALPHA);
textRegCircle[i] = TextureRegionFactory.createFromAsset(textCircle[i], this, "circlesBlue/"+i+".jpg", 0, 0);
mEngine.getTextureManager().loadTexture(textCircle[i]);
}
}
@Override
public Scene onLoadScene() {
dScene = new Scene();
dScene.attachChild(new Sprite(0, 0, Helper.CAMERA_WIDTH,
Helper.CAMERA_HEIGHT, dLoadingRegion));
new Thread(new Runnable() {
@Override
public void run() {
loadOtherGameGraphics();
dHandler.sendEmptyMessage(0);
}
}).start();
return dScene;
}
public void setYourSceneData() {
// here set your game data
// and remove your loading image
}
@Override
public void onLoadComplete() {
}
}