aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/text.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu/text.hpp')
-rw-r--r--src/menu/text.hpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/menu/text.hpp b/src/menu/text.hpp
index ad5fcb9a..7ec0dade 100644
--- a/src/menu/text.hpp
+++ b/src/menu/text.hpp
@@ -35,6 +35,7 @@
#include "drawable_control.hpp"
#include "container.hpp"
#include "utils/point.hpp"
+#include "vertical_text_alignment.hpp"
namespace usdx
{
@@ -62,15 +63,33 @@ namespace usdx
*/
bool stretch;
+ /**
+ * Offset of the baseline of the text to the top left corner of the
+ * control.
+ */
+ Point<int> offset;
+
FTFont *font;
+ const VerticalTextAlignment *valign;
+
boost::mutex font_mutex;
+ /**
+ * This function is used to recalculate the offset of the drawn
+ * text. It should be called every time the text or the font size is
+ * changed.
+ *
+ * @see: offset
+ */
+ void realign(void);
protected:
virtual void draw(void);
public:
- Text(Container* parent, const std::string text = "", const unsigned int size = 60);
+ Text(Container*, const std::string = "", const unsigned int = 60,
+ const VerticalTextAlignment* = new VerticalTextAlignmentTop());
+
virtual ~Text();
void set_font_size(const unsigned int value);