mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-05 13:51:04 +00:00
Add Lua functions (+ related text class changes):
- text_getHeight() - getUserInputString()
This commit is contained in:
parent
5336c8d350
commit
201b3a76bc
5 changed files with 21 additions and 1 deletions
|
@ -13,6 +13,7 @@ public:
|
|||
virtual void setWidth(int width) = 0;
|
||||
virtual void setFontSize(int sz) = 0;
|
||||
virtual void setAlign(Align a) = 0;
|
||||
virtual float getHeight() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
void autoKern();
|
||||
void setBitmapFontEffect(BitmapFontEffect bfe);
|
||||
void render();
|
||||
float getHeight();
|
||||
virtual float getHeight();
|
||||
void unloadDevice();
|
||||
void reloadDevice();
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@ void DebugFont::setFontSize(int sz)
|
|||
fontDrawSize = sz;
|
||||
}
|
||||
|
||||
float DebugFont::getHeight()
|
||||
{
|
||||
return fontDrawSize * lines.size() * 1.5f; // vspc in render()
|
||||
}
|
||||
|
||||
void DebugFont::formatText()
|
||||
{
|
||||
std::string text;
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
void setFontSize(int sz);
|
||||
int getNumLines() { return lines.size(); }
|
||||
virtual void setAlign(Align align);
|
||||
virtual float getHeight();
|
||||
protected:
|
||||
int fontDrawSize, textWidth;
|
||||
void formatText();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue