Reputation: 133
Does anyone know how to orient your main layout so that it is behind an Andengine scene?
What I am trying to do is overlay some AndEngine controls on top of a video stream that fills the whole screen. My video stream comes from a website, so I'm using WebView.
I thought to set the background as transparent, so that a layout could be shown underneath, but I don't know how to orient the layout this way. Basically, I'd welcome ANY way by which I can display my webview as the "background" of my app while still having the controls (that are similar to AnalogOnScreenControls) visible overtop (in the bottom left and top right corner).
If not possible, I'd settle for just implementing a webview into my andengine code, which I've done some research on, but have never actually successfully done. Any help would be greatly appreciated
Upvotes: 2
Views: 1575
Reputation: 12527
Check out the AugmentedRealityExample in the andengine examples. It features Sprites drawn ove live camera feed.
It appears the trick is to just create a scene with a transparent background: scene.setBackground(new ColorBackground(0.0f, 0.0f, 0.0f, 0.0f));
Be suire to check the superclass "BaseAugmentedRealityGameActivity" to see where he attaches the camera feed using a "CameraPreviewSurfaceView". The cameraPreviewSurfaceView extends plain old Vanilla Android.SurfaceView - so from that starting point you should be able to get accomplished what you need.
Upvotes: 2