I'm trying to overlay a SceneView on top of a WebView. The goal is to have the WebView show mp4 video using html while the Scene in SceneView renders game objects and processes touch events. (I got the mp4 and html part working.)
However, the Scene always have a solid background_color that blocks the webview content and I cannot make the Scene background transparent.
Here is a toy example:
from scene import *
import ui
class GameScene(Scene):
def setup(self):
self.background_color = None
# the background_color here only accepts RGB but not RGBA
self.view.alpha = 0.2
# this changes the alpha of the entire SceneView, making both the background and the contents transparent.
sp = SpriteNode('emj:Christmas_Tree', anchor_point=(0,0), position=(100,100), parent=self)
w, h = ui.get_window_size()
frame = (0,0,w,h)
v = ui.View(frame=frame)
webview = ui.WebView(frame=(w/4,0,w/2,h))
webview.load_url('http://google.com')
v.add_subview(webview)
gameview = SceneView()
gameview.scene = GameScene()
gameview.frame = (w/4, 0, w/2, h/2)
v.add_subview(gameview)
# overlay SceneView() on top of WebView()
gameview.bring_to_front()
v.present('full_screen')
Thanks!