Question using getFormattedLineCount(...) function
Posted: Tue Sep 20, 2005 03:16
For some reason, the getFormattedLineCount function always returns 1. I'm not sure if I'm using it correctly, or what the problem is. This is my implementation and use of the function:
font = CEGUI::FontManager::getSingleton().createFont( "datafiles/fonts/Celtic-10.font" );
font->defineFontGlyphs(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~æøåÆØÅ" );
// storyBoard1
storyBoard1 = (CEGUI::FrameWindow*)wm->createWindow("TaharezLook/FrameWindow","storyBoard1");
sheet->addChildWindow(storyBoard1);
storyBoard1->setSize(CEGUI::Size( 0.1,0.1 ));
storyBoard1->setPosition(CEGUI::Point( 0.2,0.7 ));
storyBoard1->setTitleBarEnabled(true);
storyBoard1->setSizingEnabled(false);
storyBoard1->setDragMovingEnabled(false);
storyBoard1->setCloseButtonEnabled(false);
storyBoard1->setVisible(true);
storyBoard1->setMouseCursor("WindowsLook", "MouseArrow");
// setup first storyboard
storyBoard1Text = (CEGUI::StaticText*)wm->createWindow("TaharezLook/StaticText","storyBoard1Text");
storyBoard1->addChildWindow(storyBoard1Text);
storyBoard1Text->setSize( CEGUI::Size( 0.95, 0.9 ) );
storyBoard1Text->setPosition( CEGUI::Point( 0.025, 0.05 ) );
storyBoard1Text->setHorizontalFormatting(CEGUI::StaticText::HorzFormatting::WordWrapLeftAligned);
storyBoard1Text->setText("storyBoard1Text");
storyBoard1Text->setVisible(true);
storyBoard1Text->setMouseCursor("WindowsLook", "MouseArrow");
CEGUI::uint x = font->getFormattedLineCount(currentText1,storyBoard1Text->getRect(),CEGUI::TextFormatting::LeftAligned);
currentText1 is:
Man, it sure is hot today! If it wasn't for those pesky headhunters, I'd go lay in the forest!
(sorry for my cheesy text, lol)
font = CEGUI::FontManager::getSingleton().createFont( "datafiles/fonts/Celtic-10.font" );
font->defineFontGlyphs(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~æøåÆØÅ" );
// storyBoard1
storyBoard1 = (CEGUI::FrameWindow*)wm->createWindow("TaharezLook/FrameWindow","storyBoard1");
sheet->addChildWindow(storyBoard1);
storyBoard1->setSize(CEGUI::Size( 0.1,0.1 ));
storyBoard1->setPosition(CEGUI::Point( 0.2,0.7 ));
storyBoard1->setTitleBarEnabled(true);
storyBoard1->setSizingEnabled(false);
storyBoard1->setDragMovingEnabled(false);
storyBoard1->setCloseButtonEnabled(false);
storyBoard1->setVisible(true);
storyBoard1->setMouseCursor("WindowsLook", "MouseArrow");
// setup first storyboard
storyBoard1Text = (CEGUI::StaticText*)wm->createWindow("TaharezLook/StaticText","storyBoard1Text");
storyBoard1->addChildWindow(storyBoard1Text);
storyBoard1Text->setSize( CEGUI::Size( 0.95, 0.9 ) );
storyBoard1Text->setPosition( CEGUI::Point( 0.025, 0.05 ) );
storyBoard1Text->setHorizontalFormatting(CEGUI::StaticText::HorzFormatting::WordWrapLeftAligned);
storyBoard1Text->setText("storyBoard1Text");
storyBoard1Text->setVisible(true);
storyBoard1Text->setMouseCursor("WindowsLook", "MouseArrow");
CEGUI::uint x = font->getFormattedLineCount(currentText1,storyBoard1Text->getRect(),CEGUI::TextFormatting::LeftAligned);
currentText1 is:
Man, it sure is hot today! If it wasn't for those pesky headhunters, I'd go lay in the forest!
(sorry for my cheesy text, lol)