私は自分のシーンの背景を設定したいと思っていますが、どうすればいいですか?私はこれについてたくさん読んでいたが、私はこれをすることはできない。 Andengineと私のスタートは、私の問題のための正確な情報が見つけにくい、すべてが主観的です。Andengineのシーンに背景を追加するAndroid
まあ、私はシーン内にスプラッシュ画面を実装し、すべてのリソースとシーンをロードしています。 (https://sites.google.com/site/matimdevelopment/splash-screen---easy-way)
次に、私はmenuSceneにBackgroundを設定する必要があります。私はTextureRegionと各バックグラウンドを作成するBitmapTextureAtlas。
宣言テクスチャ::私はこれを行う
//Fondo escenas
private TextureRegion menuBgTexture;
private BitmapTextureAtlas menuBackgroundTexture;
負荷資源及び(スプラッシュが終了したときに彼らはonPopulateSceneで呼ばれている)シーンをロード
public void loadResources()
{
//FondoMenu
menuBackgroundTexture = new BitmapTextureAtlas(null, 480, 320, TextureOptions.DEFAULT);
menuBgTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.menuBackgroundTexture, this, "menubg.png", 0, 0);
//Cargamos los fondos
mEngine.getTextureManager().loadTexture(this.menuBackgroundTexture);
}
private void loadScenes()
{
//Menú
menuScene = new Scene();
final float centerX = (CAMERA_WIDTH - menuBgTexture.getWidth())/2;
final float centerY = (CAMERA_HEIGHT - menuBgTexture.getHeight())/2;
SpriteBackground bg = new SpriteBackground(new Sprite(centerX, centerY, menuBgTexture));
menuScene.setBackground(bg);
//menuScene.setBackground(new Background(50, 0, 0));
//Options
optionsScene = new Scene();
//Juego
gameScene = new Scene();
//Pausa
pauseScene = new Scene();
//Gameover
gameOverScene = new Scene();
}
負荷リソースがない、ラインのエラーが、loadScenesを示し: SpriteBackground bg = new SpriteBackground(新しいスプライト(centerX、centerY、menuBgTexture));
新しい属性(ISpriteVertexBufferObject)を設定する必要がありますが、これは何ですか? VBOManagerオブジェクトの
どのGLESを使用していますか? GLES2?私はGLES2のonCreateResources()を持っています。なぜNicolas Gramlichがこのような重要な機能の名前を変更することにしたのか、そしてなぜドキュメンテーションなしでエンジン/ライブラリを作成したのかわかりません。誰でも助けてもらえますか? – shailenTJ
ドキュメンテーションになったときに彼が何を考えていたかを誰が知っていますか?そして、神はエンジンに関するフォーラムでこのことについて何も言いません。もしあなたがソースコードを読んで作業しなければならないと言われたら、うーん、良いですが、その事のためのソースコードには何のコメントもありません。それは残念ながら実際にはちょっとしたオープンソースエンジンなのです.D – Spider
私も同様の問題に直面しています...自分の背景を設定することができません。ここにコードです..menuBackgroundTexture = new BitmapTextureAtlas null、2 * CAMERA_WIDTH、2 * CAMERA_HEIGHT、TextureOptions.DEFAULT); \t menuBgTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.menuBackgroundTexture、this、 "land.png"、0、0); \t \t SpriteBackground bg = new SpriteBackground(新しいスプライト(0、0、menuBgTexture、this.getVertexBufferObjectManager())); \t \t mScene.setBackground(bg); ....誰でも助けてくれますか? – Rahul