summaryrefslogtreecommitdiff
path: root/Client/Source/GUI/TextMeshGenerator.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-12-13 00:07:19 +0800
committerchai <chaifix@163.com>2021-12-13 00:07:19 +0800
commit60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 (patch)
treeb2c7b0a868f18159dbc43d8954e1bd7668549a88 /Client/Source/GUI/TextMeshGenerator.h
+init
Diffstat (limited to 'Client/Source/GUI/TextMeshGenerator.h')
-rw-r--r--Client/Source/GUI/TextMeshGenerator.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/Client/Source/GUI/TextMeshGenerator.h b/Client/Source/GUI/TextMeshGenerator.h
new file mode 100644
index 0000000..acc0a0a
--- /dev/null
+++ b/Client/Source/GUI/TextMeshGenerator.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <vector>
+#include <unordered_map>
+
+#include "../Debug/Log.h"
+#include "../Graphics/Color.h"
+
+#include "UITextMesh.h"
+#include "Font.h"
+
+// 逐步回收长期没用到的textmesh
+class GraduallyReleaseTextMesh
+{
+};
+
+struct UITextMeshList {
+ UITextMesh* mesh;
+ UITextMeshList* next;
+};
+
+class TextMeshGenerator : public Singleton<TextMeshGenerator>
+{
+public:
+ const UITextMesh* GetTextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 col32, ETextAnchor anchor, ETextAlignment alignment, bool wordwrap, float preferred);
+
+private:
+ std::unordered_map<uint32_t, UITextMeshList*> m_TextMeshes;
+};
+
+#define g_TextMeshGenerator (*TextMeshGenerator::Instance()) \ No newline at end of file