diff --git a/direct/src/gui/OnscreenText.py b/direct/src/gui/OnscreenText.py index c8e2a0c5a9..4928c60e20 100644 --- a/direct/src/gui/OnscreenText.py +++ b/direct/src/gui/OnscreenText.py @@ -29,6 +29,7 @@ class OnscreenText(DirectObject, NodePath): align = None, wordwrap = None, drawOrder = None, + decal = 0, font = None, parent = None, sort = 0, @@ -81,6 +82,10 @@ class OnscreenText(DirectObject, NodePath): The text will actually use drawOrder through drawOrder + 2. + decal: if this is True, the text is decalled onto its + background card. Useful when the text will be parented + into the 3-D scene graph. + font: the font to use for the text. parent: the NodePath to parent the text to initially. @@ -154,6 +159,9 @@ class OnscreenText(DirectObject, NodePath): self.pos = pos self.roll = roll + if decal: + textNode.setCardDecal(1) + if font == None: font = DirectGuiGlobals.getDefaultFont() @@ -231,6 +239,11 @@ class OnscreenText(DirectObject, NodePath): # text, and for those rare occasions when you actually want to # change a text's property after it has been created. + def setDecal(self, decal): + self.textNode.setCardDecal(decal) + + def getDecal(self): + return self.textNode.getCardDecal() def setFont(self, font): self.textNode.setFont(font)