WINTERMUTE: add UIButton::setTextAlign

This commit is contained in:
Tobia Tesan 2013-09-20 17:52:25 +02:00
parent 417bf3db02
commit 2a977dec8c
3 changed files with 11 additions and 3 deletions

View File

@ -171,7 +171,7 @@ bool AdResponseBox::createButtons() {
}
btn->putFontHover((_fontHover == nullptr) ? _gameRef->getSystemFont() : _fontHover);
btn->putFontPress(btn->getFontHover());
btn->_align = _align;
btn->setTextAlign(_align);
if (_gameRef->_touchInterface) {
btn->putFontHover(btn->getFont());

View File

@ -1226,4 +1226,10 @@ void UIButton::putImagePress(BaseSprite *sprite) {
_imagePress = sprite;
}
void UIButton::setTextAlign(TTextAlign align) {
_align = align;
}
} // End of namespace Wintermute

View File

@ -38,7 +38,6 @@ namespace Wintermute {
class UIButton : public UIObject {
public:
uint32 _oneTimePressTime;
DECLARE_PERSISTENT(UIButton, UIObject)
void press();
virtual bool display() { return display(0, 0); }
@ -58,12 +57,13 @@ public:
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
TTextAlign _align;
void putFontHover(BaseFont *font);
BaseFont *getFontHover();
void putFontPress(BaseFont *font);
void setTextAlign(TTextAlign align);
void putImageHover(BaseSprite *sprite);
void putImagePress(BaseSprite *sprite);
@ -86,6 +86,8 @@ private:
BaseSprite *_imagePress;
BaseSprite *_imageDisable;
BaseSprite *_imageFocus;
uint32 _oneTimePressTime;
TTextAlign _align;
};