次のようなメニュー項目を含むゲームメニューを作成しようとしています。
- 新しいゲーム
- マルチプレイヤー
- オプション
- 出口
このメニュー項目を透明にしたい。白い色のテキストのみが表示されます。
だから私はメニュー項目の背景画像は必要ないと思います。
以下に示すようなSpriteButtonの例を見てきました。
ButtonSprite playButton = new ButtonSprite(0, 0, btnNormalTextureRegion, btnPushedTextureRegion, this.getVertexBufferObjectManager(), new OnClickListener() {
@Override
public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) {
// Do Stuff here
}
}
私が理解していないのは、どうすればbtnNormalTextureRegionを初期化できるかということです。
以下のコードを使用して、オブジェクトのITextureとITextureRegionを初期化します。
mBackgruondTexture = new BitmapTexture(activity.getTextureManager(), new IInputStreamOpener() {
public InputStream open() throws IOException {
return activity.getAssets().open("gfx/backgrounds/greenbg.jpg");
}
});
mBackgruondTextureRegion = TextureRegionFactory.extractFromTexture(mBackgruondTexture);
このコードは、assestから画像を開きます。
メニュー項目に画像を使用したくないので、SpriteButtonのbtnNormalTextureRegionを初期化するにはどうすればよいですか。
また
Is there any alternative to create Game Menu?