void TextBox::CalcTextWidth() { // analyze the text length FontPtr pFont = Renderer::GetInstance().GetFont(mTextSize); unsigned width = mSize.x; float textWidth; mMultiLineText = pFont->InsertLineFeed((const char*)mTextw.c_str(), mTextw.size() * 2, width, &textWidth, &mNumTextLines); mTextWidth = (unsigned)Round(textWidth); pFont->SetBackToOrigHeight(); mUIObject->SetText(mMultiLineText.c_str()); }