[SOLVED] Render + TextNode + Background Color

I’m using a textnode in the 3d world (attached to render) and I can’t get a correct background color.

    self.text = TextNode('node')
    self.text.setCardAsMargin(0, 0, 0, 0)

A text node is created but the background color is over the text color so I can’t read the text. I tried without the “Card” and I get a correct text with a transparent background.

How can I use a background color ?

Where did you attach the text? It makes a difference whether you parent it to render or render2d, because of the different render-order requirements for both scene graphs.

Under render, you might also need to call:


which enables a slightly-more-expensive rendering mode that should guarantee the card appears behind the text.


It was attached to render.

Thank you for this solution it works very well.