mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-19 05:06:25 -04:00
add setDecal
This commit is contained in:
parent
430a4b21e0
commit
b57675552f
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user