如何添加一个SurfaceView,显示相机预览作为AndEngine的BaseGameActivity的背景(物理示例)。
@Override
public Scene onLoadScene() {
mBackgroundView = new PreviewView(this);
addContentView(mBackgroundView, new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); // Does not work
addContentView(mBackgroundView.getOverlay(), new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); // Works. getOverlay() returns an ImageView.
final Scene scene = new Scene(1);
//scene.setBackground(new ColorBackground(0.0f, 0.0f, 0.0f, 0.0f));