Skip to content

Commit d475400

Browse files
committed
Panda3D exapmple updated, added transparency test, set
TEST_TRANSPARENCY to True to see transparent background in the browser.
1 parent beae95e commit d475400

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cefpython/cef1/windows/binaries/panda3d_.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
# TODO: fix the blurriness of the browser when window is resized.
1818

19+
TEST_TRANSPARENCY = False
20+
1921
import platform
2022
if platform.architecture()[0] != "32bit":
2123
raise Exception("Only 32bit architecture is supported")
@@ -37,6 +39,7 @@
3739
loadPrcFileData("", "Panda3D example")
3840
loadPrcFileData("", "fullscreen 0")
3941
loadPrcFileData("", "win-size 1024 768")
42+
from pandac.PandaModules import TransparencyAttrib
4043

4144
import direct.directbase.DirectStart
4245
from panda3d.core import *
@@ -105,11 +108,15 @@ def __init__(self):
105108
node = cardMaker.generate()
106109
self.nodePath = render2d.attachNewNode(node)
107110
self.nodePath.setTexture(self.texture)
111+
if TEST_TRANSPARENCY:
112+
self.nodePath.setTransparency(TransparencyAttrib.MAlpha)
108113
self.nodePath.setHpr(0, 0, 5)
109114

110115
windowHandle = base.win.getWindowHandle().getIntHandle()
111116
windowInfo = cefpython.WindowInfo()
112117
windowInfo.SetAsOffscreen(windowHandle)
118+
if TEST_TRANSPARENCY:
119+
windowInfo.SetTransparentPainting(True)
113120

114121
# By default window rendering is 30 fps, let's change
115122
# it to 60 for better user experience when scrolling.

0 commit comments

Comments
 (0)