This commit is contained in:
parent
9bc47a36d2
commit
3a59634c25
2 changed files with 28 additions and 3 deletions
|
@ -98,6 +98,30 @@ void CGUITextBox::render()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int CGUITextBox::getTextWidth()
|
||||||
|
{
|
||||||
|
return getFontBank()->getStringWidth((char*)TranslationDatabase::getString(getTextId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int CGUITextBox::getTextHeight()
|
||||||
|
{
|
||||||
|
return getFontBank()->getStringHeight((char*)TranslationDatabase::getString(getTextId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
|
|
@ -43,10 +43,14 @@ public:
|
||||||
|
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
||||||
|
int getTextWidth();
|
||||||
|
int getTextHeight();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void recalc();
|
void recalc();
|
||||||
|
|
||||||
|
int getTextId() {return m_textId;}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int m_textId;
|
unsigned int m_textId;
|
||||||
|
@ -55,9 +59,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Globals
|
Globals
|
||||||
------- */
|
------- */
|
||||||
|
|
Loading…
Add table
Reference in a new issue