usingAFont.cpp

00001 // Load the font from disk
00002 // "data/fonts/palatino" will look for "data/fonts/palatino.fnt"
00003 // and "data/fonts/palatino.png" by default
00004 Propane::Font myNewFont("data/fonts/palatino");
00005 if(!myNewFont.ready()) {
00006         std::cerr << "Load of font failed." << std::endl;
00007         return;
00008 }
00009 myNewFont.print(30, 30, "Hello world!");
00010 myNewFont.print(30, 30 + myNewFont.getLineHeight(), "This line is under the previous one");
00011 myNewFont.setFontColour(0.0f, 1.0f, 0.0f, 1.0f);
00012 myNewFont.print(30, 30 + myNewFont.getLineHeight() * 2,
00013                 "This text is green.");
00014 // Print using the sine function, 0.25f x-step per letter, 6.25f pixel amplitude maximum
00015 myNewFont.mathPrint(30, 30 + myNewFont.getLineHeight() * 3,
00016                 0.0f, 0.25f, 6.25f, sinf, "This text is wavy.");

Generated on Sun Jan 14 16:49:10 2007 for Propane Injector by  doxygen 1.4.6