Just figured out the solution!
It's very simple. Just need to call glClearColor(0, 0, 0, 0)
and glClear(GL_COLOR_BUFFER_BIT)
at every frame by in draw()
class ChristmasScene(Scene):
def setup(self):
objv = ObjCInstance(self.view)
objv.glkView().setOpaque_(False)
sp = SpriteNode('emj:Christmas_Tree', anchor_point=(0,0), position=(500,300), parent=self))
def draw(self):
glClearColor(0, 0, 0, 0)
glClear(GL_COLOR_BUFFER_BIT)
# The rest of the code is the same as the most recent reply. No need to set up a separate delegate.
For this to work, the WebView
has to be a subview
of the SceneView
. Adding WebView
and SceneView
as subviews of the same SuperView
does not work well. Hope this doesn't break other drawing steps. Thanks again @JonB and @cvp for the help! Previous code examples from @omz and @Cethric also helped a lot for me to understand how things work.