2

如何添加显示相机预览的 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));
4

0 回答 0