TextNode in cxx ?

I am currently working on a school project, and I search through the panda3d src codes and found Textnode.h. After reading the documentation I still cant get my text up onto the screen. Any help will be greatly appreciated. :slight_smile:

Thanks.

There’s a whole section in the manual about rendering text to the screen. Have you read Text and Image Rendering and the following pages?

David

Thanks, so its not much different from cxx. i see… Thank again.

In the Roaming Ralph in C++ code you can also see how it creates a textnode:

  PT(TextNode) tn = new TextNode("instructions");
  tn->set_text(msg);
  NodePath tnp (win_ptr->get_aspect_2d().attach_new_node(tn));
  tnp.set_pos(-1.3,0,pos);
  tnp.set_scale(0.05);

HTH.

0o… where do you get the c++ code for the Roaming Ralph ?? Sry if this question is silly. But I only found the py code given by panda3d.

I posted it a week or so ago right here at the forums.

wow. thank you so much !

  PT(TextNode) tn = new TextNode("instructions"); 
  tn->set_text(msg); 
  NodePath tnp (win_ptr->get_aspect_2d().attach_new_node(tn)); 
  tnp.set_pos(-1.3,0,pos); 
  tnp.set_scale(0.05);

similarly i need help for my school’s project. but what’s the win_ptr in the above code? cause i wasnt able to download the code from your roaming ralph post. thanks. or could anyone forward a link for me to get the roaming ralph’s cxx code? thanks.

win_ptr is a pointer to the WindowFramework.
win_ptr is also called window in that manual page and in some tutorials.
Here is the link to the download of RR in C++.

oh thanks. i managed to download it later by removing the .gz from the link… but thanks anyway =)