From 60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 13 Dec 2021 00:07:19 +0800 Subject: +init --- Client/Source/GUI/TextMeshGenerator.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Client/Source/GUI/TextMeshGenerator.h (limited to 'Client/Source/GUI/TextMeshGenerator.h') 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 +#include + +#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 +{ +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 m_TextMeshes; +}; + +#define g_TextMeshGenerator (*TextMeshGenerator::Instance()) \ No newline at end of file -- cgit v1.1-26-g67d0