working on new text engine
This commit is contained in:
@@ -291,7 +291,7 @@ void Menu::render()
|
||||
}
|
||||
else
|
||||
{
|
||||
mText->write(mItem[i].x, mItem[i].y, mItem[i].label, 0);
|
||||
mText->write(mItem[i].x, mItem[i].y, mItem[i].label);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ void Menu::addItem(std::string text, const Uint8 hPaddingUp, const Uint8 hPaddin
|
||||
if (mTotalItems == 0)
|
||||
{
|
||||
mItem[mTotalItems].label = text;
|
||||
mItem[mTotalItems].w = mText->lenght(mItem[mTotalItems].label, 0);
|
||||
mItem[mTotalItems].w = mText->lenght(mItem[mTotalItems].label);
|
||||
mItem[mTotalItems].h = mText->getCharacterWidth() + (mVerticalPadding * 2);
|
||||
mItem[mTotalItems].x = mPosX;
|
||||
mItem[mTotalItems].y = mPosY;
|
||||
@@ -430,7 +430,7 @@ void Menu::addItem(std::string text, const Uint8 hPaddingUp, const Uint8 hPaddin
|
||||
if (mTotalItems < 10)
|
||||
{
|
||||
mItem[mTotalItems].label = text;
|
||||
mItem[mTotalItems].w = mText->lenght(mItem[mTotalItems].label, 0);
|
||||
mItem[mTotalItems].w = mText->lenght(mItem[mTotalItems].label);
|
||||
mItem[mTotalItems].h = mText->getCharacterWidth() + (mVerticalPadding * 2);
|
||||
mItem[mTotalItems].x = mPosX;
|
||||
mItem[mTotalItems].y = mItem[mTotalItems - 1].y + mItem[mTotalItems - 1].h + mItem[mTotalItems - 1].hPaddingDown;
|
||||
@@ -447,7 +447,7 @@ void Menu::addItem(std::string text, const Uint8 hPaddingUp, const Uint8 hPaddin
|
||||
void Menu::setItemCaption(Uint8 index, std::string text)
|
||||
{
|
||||
mItem[index].label = text;
|
||||
mItem[index].w = mText->lenght(mItem[index].label, 0);
|
||||
mItem[index].w = mText->lenght(mItem[index].label);
|
||||
reorganize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user