15 #include "eventHandler.h" 18 #include "eggLoader.h" 20 #include "pt_NamedNode.h" 22 extern PT_NamedNode render;
23 extern PT_NamedNode egg_root;
26 extern int framework_main(
int argc,
char *argv[]);
33 text_node->set_text(
"I'm a woo woo woo!");
35 nout <<
"text is " << text_node->get_width() <<
" by " 36 << text_node->get_height() <<
"\n";
40 text_node->set_wordwrap(5.0);
42 nout <<
"text is " << text_node->get_width() <<
" by " 43 << text_node->get_height() <<
"\n";
50 text_node =
new TextNode(
"text_node");
51 PT_NamedNode font = loader.load_sync(
"cmr12");
52 text_node->set_font(font.p());
53 text_node->set_wordwrap(20.0);
54 text_node->set_card_as_margin(0.25, 0.25, 0.25, 0.25);
56 tex->set_name(
"genericButton.rgb");
57 tex->set_minfilter(SamplerState::FT_linear);
58 tex->set_magfilter(SamplerState::FT_linear);
59 tex->read(
"/beta/toons/textures/smGreyButtonUp.rgb");
60 text_node->set_card_texture( tex );
61 text_node->set_card_border(0.1, 0.1);
62 text_node->set_text( textStr );
63 text_node->set_text_color( 0.0, 0.0, 0.0, 1.0 );
64 if (text_node->has_card_texture())
65 nout <<
"I've got a texture!" <<
"\n";
67 nout <<
"I don't have a texture..." <<
"\n";
68 nout <<
"text is " << text_node->get_width() <<
" by " 69 << text_node->get_height() <<
"\n";
71 new RenderRelation(egg_root, text_node);
74 int main(
int argc,
char *argv[]) {
75 define_keys = &text_keys;
80 return framework_main(argc, argv);
A class to monitor events from the C++ side of things.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
bool add_hook(const string &event_name, EventFunction *function)
Adds the indicated function to the list of those that will be called when the named event is thrown...
The primary interface to this module.
A ConstPointerTo is similar to a PointerTo, except it keeps a const pointer to the thing...