diff options
author | chai <chaifix@163.com> | 2021-12-13 00:07:19 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-12-13 00:07:19 +0800 |
commit | 60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 (patch) | |
tree | b2c7b0a868f18159dbc43d8954e1bd7668549a88 /Client/Source/GUI/TextMeshGenerator.h |
+init
Diffstat (limited to 'Client/Source/GUI/TextMeshGenerator.h')
-rw-r--r-- | Client/Source/GUI/TextMeshGenerator.h | 31 |
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 |