开发者

AndEngine & SurfaceView (CameraPreview)

How do you add a SurfaceView showing the camera preview as the background of the BaseGameActivity of AndEngine (Physics Example).

@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);
            开发者_JAVA百科    //scene.setBackground(new ColorBackground(0.0f, 0.0f, 0.0f, 0.0f));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜