Attaching text to a node (which isn't the guiNode)

Hi guys, this is driving me crazy. I’m trying to add a BitmapText to a node (not guiNode) so that every trasformation to the parent node reflects on the text. My code goes more or less like this:

textNode = new Node();
text = new BitmapText(...);
// setting up text (size, color, text, translation...)

This doesn’t work. I read of BillboardControl and tryied to use it but with no outcome. What’s wrong with my code? Thank you for your attention.

Define “doesn’t work”.

Also, screenshot would help.

Nothing happens. I’d expect the text to show up at the center of the screen but it doesn’t. Everything is ok if I attach the text to the guiNode and follow the “standard procedure” to update its position when needed, but having the text attached to some other node would make things way easier.

Unfortunately, the screenshot would just be a black screen.

Did you try moving around the camera? You may be looking the top-left corner of a massive text label.

…funny, this would be the most important part for us to see since this is where the problem is. :-/

Yep, your text is most likely simply behind the camera, turned the wrong way, super huge or super small. If the coords and sizes work in the gui node (which has pixel units) they most certainly won’t work in the scene (which has world units).

Yep, text is in x/y plane, too… so using the billboard control without rotating it properly under the billboarded node only makes sure you will never see it.

You were right guys, it was super huge. On top of that, i was scaling it to double its size because I thought it was too small to be seen… lol :slight_smile: Thank you for your replies anyway :blush:

Sorry, must reopen the thread.

Texts have this awkward black background. I’ve never seen such a thing so far and I can’t spot out why it is so. Any idea why it happens? I don’t know what code I should paste exactly so let me know.

Since it’s transparent… put it in the transparent bucket. And/or search the forum for “text with black background” as I’m sure this is asked periodically and definitely within the last week.

Ok, thank you!