问题
I'm starting to use AndEngine in my app. I've used an xml to define the base style of the app. I've defined a scene in which I'll have some draggable sprites.
I've imported correctly the xml but the scene appears on top of that with a black background that hides the xml graphics. I need to set the scene with transparent background.
How can i do that?
回答1:
Actually you can do that.
It was at least working some time ago with AndEngine running on top of a Camera preview.
It has really been a while since I did this and I didn't keep it up to date, but this class should be of interest for you: http://code.google.com/p/andengineaugmentedrealityextension/source/browse/src/org/anddev/andengine/extension/augmentedreality/BaseAugmentedRealityGameActivity.java
回答2:
The default background of the scene is black. you can't change it.
回答3:
It can change . Use this code.
@Override
public Scene onLoadScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
final Scene scene = new Scene();
scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
来源:https://stackoverflow.com/questions/7905792/android-andengine-set-scene-background-as-trasparent