summaryrefslogtreecommitdiff
path: root/Runtime/GUI/UITextMesh.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-03 09:52:26 +0800
committerchai <chaifix@163.com>2021-11-03 09:52:26 +0800
commitc10e0d92f46e5eaf25a69e1fafe5f4dbd8eaab9d (patch)
tree2eb1a91339b35fea68f48b2774355f496519db83 /Runtime/GUI/UITextMesh.h
parent3898f2c648b1a731dead8337aad8912d2b8b80d7 (diff)
*misc
Diffstat (limited to 'Runtime/GUI/UITextMesh.h')
-rw-r--r--Runtime/GUI/UITextMesh.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/Runtime/GUI/UITextMesh.h b/Runtime/GUI/UITextMesh.h
new file mode 100644
index 0000000..c88e52f
--- /dev/null
+++ b/Runtime/GUI/UITextMesh.h
@@ -0,0 +1,50 @@
+#pragma once
+#include "../Graphics/VertexBuffer.h"
+#include "Font.h"
+#include "Runtime/Utilities/Exception.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,
+ TextAnchor_DontCare
+};
+
+enum ETextAlignment {
+ TextAlignment_Left,
+ TextAlignment_Center,
+ TextAlignment_Right,
+ TextAlignment_Auto,
+};
+
+typedef unsigned long long TextMeshHash;
+
+namespace TextHelper
+{
+ TextMeshHash GetTextMeshHash();
+}
+
+class UITextMesh
+{
+public:
+ UITextMesh(const UnicodeString& str, Font* font, int pixelSize, ETextAnchor anchor, ETextAlignment alignment)/*throw TextMeshException*/;
+
+ ~UITextMesh();
+
+ void Draw();
+
+private:
+ Font* m_Font;
+ std::unordered_map<int/*IndexOfAtlas*/, VertexBuffer*> m_VBOs;
+
+}; \ No newline at end of file