diff options
Diffstat (limited to 'Runtime/GUI/TextMesh.h')
-rw-r--r-- | Runtime/GUI/TextMesh.h | 23 |
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; + }; |