Two question:
1 How to use setCardTexture function in TextNode class?
def initText(self):
self.text = TextNode("text node")
font = loader.loadFont("CALIBRIZ.TTF")
self.text.setFont(font)
self.text.setTextColor(1,0,0,1)
#self.text.setshadow(0.05,0.05)
#self.text.setShadowColor(0,0,0,1)
self.text.setWordwrap(10)
self.text.setAlign(TextNode.ACenter)
#self.text.setFrameColor(0,0,1,1)
#self.text.setFrameAsMargin(0.2,0.2,0.1,0.1)
self.text.setCardColor(1,1,1,1)
#self.text.setCardAsMargin(0,0,0,0)
texture = loader.loadTexture("test.jpg")
self.text.setCardTexture(texture)
textNodePath = self.actor.attachNewNode(self.text)
textNodePath.setScale(3)
textNodePath.setPos(20,0,13)
the card hasn’t a texture on it. And I print texture, it’s loaded successful. So what happened? how to use setCardTexture ?
2 Another question: how to hide a TextNode? For example, when my character sayes some words, the textnode will show with the words. After seconds, the textnode will disappear. How to do it ?
[/img]
[/code]