summaryrefslogtreecommitdiff
path: root/Runtime/GUI/TextMesh.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-02 09:30:25 +0800
committerchai <chaifix@163.com>2021-11-02 09:30:25 +0800
commitb7511abf1a1f302b5c7ebf50faaf65b62d7bb6ed (patch)
tree7265398e248b55ede4b3550ec47660be334bf1ff /Runtime/GUI/TextMesh.h
parenta11097e51fcaef4488218411f2d7b3ee34550000 (diff)
* TextMesh
Diffstat (limited to 'Runtime/GUI/TextMesh.h')
-rw-r--r--Runtime/GUI/TextMesh.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/Runtime/GUI/TextMesh.h b/Runtime/GUI/TextMesh.h
index 2ca4618..8a29c92 100644
--- a/Runtime/GUI/TextMesh.h
+++ b/Runtime/GUI/TextMesh.h
@@ -1,5 +1,10 @@
#pragma once
#include "../Graphics/VertexBuffer.h"
+#include "Font.h"
+#include "Runtime/Utilities/Exception.h"
+#include <unordered_map>
+
+CustomException(TextMeshException);
enum ETextAnchor
{
@@ -22,11 +27,27 @@ enum ETextAlignment {
TextAlignment_Auto,
};
+typedef unsigned long long TextMeshHash;
+
+namespace TextHelper
+{
+ TextMeshHash GetTextMeshHash();
+}
+
+// 一段文字里面的网格可能会来自不同的atlas,在生成TextMesh时做好合批
+
class TextMesh
{
public:
+ TextMesh(const UnicodeString& str, Font* font, int pixelSize, ETextAnchor anchor, ETextAlignment alignment)/*throw TextMeshException*/;
+
+ ~TextMesh();
+
+ void Draw();
private:
- VertexBuffer* m_VBO;
+ Font* m_Font;
+ std::unordered_map<int/*IndexOfAtlas*/, VertexBuffer*> m_VBOs;
+
};