summaryrefslogtreecommitdiff
path: root/Client/Source/GUI/UITextMesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Source/GUI/UITextMesh.h')
-rw-r--r--Client/Source/GUI/UITextMesh.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/Client/Source/GUI/UITextMesh.h b/Client/Source/GUI/UITextMesh.h
new file mode 100644
index 0000000..869db80
--- /dev/null
+++ b/Client/Source/GUI/UITextMesh.h
@@ -0,0 +1,69 @@
+#pragma once
+
+#include "../Graphics/VertexBuffer.h"
+#include "../Utilities/Exception.h"
+#include "../Graphics/Color.h"
+
+#include "Font.h"
+
+#include <unordered_map>
+
+CustomException(TextMeshException);
+
+enum ETextAnchor
+{
+ TextAnchor_UpperLeft,
+ TextAnchor_UpperCenter,
+ TextAnchor_UpperRight,
+ TextAnchor_MiddleLeft,
+ TextAnchor_MiddleCenter,
+ TextAnchor_MiddleRight,
+ TextAnchor_LowerLeft,
+ TextAnchor_LowerCenter,
+ TextAnchor_LowerRight,
+};
+
+enum ETextAlignment {
+ TextAlignment_Left,
+ TextAlignment_Center,
+ TextAlignment_Right,
+};
+
+namespace TextHelper
+{
+}
+
+class UITextMesh
+{
+public:
+ void Draw() const;
+
+private:
+ friend class TextMeshGenerator;
+
+ UITextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 color32 = Color32::white, ETextAnchor anchor = TextAnchor_UpperLeft, ETextAlignment alignment = TextAlignment_Left, bool wordwrap = false, float preferred = 0)/*throw TextMeshException*/;
+ ~UITextMesh();
+
+ GET(const Font*, Font, m_Font);
+ GET(int, PixelSize, m_PixelSize);
+ GET(int, LineHeight, m_LineHeight);
+ GET(Color32, Color, m_Color);
+ GET(ETextAlignment, Alignment, m_Alignment);
+ GET(ETextAnchor, Anchor, m_Anchor);
+ GET(bool, Wordwrap, m_Wordwrap);
+ GET(float, Preferred, m_Preferred);
+ GET(const UnicodeString&, Content, m_Content);
+
+ std::unordered_map<int, VertexBuffer*> m_VBOs;
+
+ Font* m_Font;
+ UnicodeString m_Content;
+ int m_PixelSize;
+ int m_LineHeight;
+ Color32 m_Color;
+ ETextAlignment m_Alignment;
+ ETextAnchor m_Anchor;
+ bool m_Wordwrap;
+ float m_Preferred;
+
+}; \ No newline at end of file