/* g++ -g -std=gnu++11 -I../panda3d/built/include -o pandatext pandatext.cpp \ -L../panda3d/built/lib -lp3framework -lpanda -lpandaexpress -lp3dtool -lp3dtoolconfig \ -lpthread */ #include "pandaFramework.h" int main(int argc, char *argv[]) { PandaFramework framework; framework.open_framework(argc, argv); framework.set_window_title("Text String Window"); // load trees-and-rocks scene WindowFramework *window = framework.open_window(); NodePath scene = window->load_model(framework.get_models(), "models/environment"); scene.reparent_to(window->get_render()); scene.set_scale(0.25f, 0.25f, 0.25f); scene.set_pos(-8, 42, 0); // display text string near upper left corner based on pixels // so it stays same size regardless of window resizing PT(TextNode) text = new TextNode("SomeTextNode"); text->set_text("Some Text String"); NodePath textNodePath = window->get_pixel_2d().attach_new_node(text); textNodePath.set_scale(12.0); textNodePath.set_pos(100.0,0,-40.0); // need code to get pixel location and size of text // either from text or textNodePath // ?? // display then close up framework.main_loop(); framework.close_framework(); return (0); }