2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-15 23:37:02 +00:00

Text alignment and Text Button

This commit is contained in:
Jack Andersen
2015-12-13 11:00:30 -10:00
parent 72bd17890d
commit 2efa64b7b0
8 changed files with 278 additions and 94 deletions

View File

@@ -14,11 +14,21 @@ class ViewResources;
class TextView : public View
{
public:
enum class Alignment
{
Left,
Center,
Right
};
private:
size_t m_capacity;
boo::IGraphicsBufferD* m_glyphBuf;
boo::IVertexFormat* m_vtxFmt = nullptr; /* OpenGL only */
boo::IShaderDataBinding* m_shaderBinding;
const FontAtlas& m_fontAtlas;
Alignment m_align;
bool m_valid = false;
int m_width = 0;
@@ -44,8 +54,8 @@ public:
#endif
};
TextView(ViewResources& res, View& parentView, const FontAtlas& font, size_t capacity=256);
TextView(ViewResources& res, View& parentView, FontTag font, size_t capacity=256);
TextView(ViewResources& res, View& parentView, const FontAtlas& font, Alignment align=Alignment::Left, size_t capacity=256);
TextView(ViewResources& res, View& parentView, FontTag font, Alignment align=Alignment::Left, size_t capacity=256);
struct RenderGlyph
{