From be9870f5c1ba4f6ae8cd9764f1a8ed56ee81ddd5 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 5 Nov 2021 09:39:41 +0800 Subject: *misc --- Runtime/GUI/TextMeshGenerator.cpp | 10 ++++++++++ Runtime/GUI/TextMeshGenerator.h | 2 +- Runtime/GUI/UITextMesh.cpp | 18 +++++++++--------- Runtime/GUI/UITextMesh.h | 4 +--- 4 files changed, 21 insertions(+), 13 deletions(-) (limited to 'Runtime/GUI') diff --git a/Runtime/GUI/TextMeshGenerator.cpp b/Runtime/GUI/TextMeshGenerator.cpp index e69de29..98d3b09 100644 --- a/Runtime/GUI/TextMeshGenerator.cpp +++ b/Runtime/GUI/TextMeshGenerator.cpp @@ -0,0 +1,10 @@ +#include "TextMeshGenerator.h" + +UITextMesh* TextMeshGenerator::GetTextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 col32, ETextAnchor anchor, ETextAlignment alignment, bool wordwrap, float preferred) +{ + for (int i = 0; i < m_TextMeshes.size(); ++i) + { + UITextMesh* tm = m_TextMeshes[i]; + + } +} diff --git a/Runtime/GUI/TextMeshGenerator.h b/Runtime/GUI/TextMeshGenerator.h index 3598cb0..dd4f1d9 100644 --- a/Runtime/GUI/TextMeshGenerator.h +++ b/Runtime/GUI/TextMeshGenerator.h @@ -24,7 +24,7 @@ public: class TextMeshGenerator : public Singleton { public: - UITextMesh* GetTextMesh(const UnicodeString& str); + UITextMesh* GetTextMesh(const UnicodeString& str, Font* font, int pixelSize, int lineHeight, Color32 col32, ETextAnchor anchor, ETextAlignment alignment, bool wordwrap, float preferred); private: std::vector m_TextMeshes; diff --git a/Runtime/GUI/UITextMesh.cpp b/Runtime/GUI/UITextMesh.cpp index 39bed55..24aff47 100644 --- a/Runtime/GUI/UITextMesh.cpp +++ b/Runtime/GUI/UITextMesh.cpp @@ -53,15 +53,15 @@ InitializeStaticVariables([]() { }); UITextMesh::UITextMesh( - const UnicodeString& str // 文本 - , Font* font // 字体 - , int pixelSize // 大小 - , int lineHeight // 行高 - , Color32 color32 // 颜色 - , ETextAnchor anchor // 锚点 - , ETextAlignment alignment // 对齐方式 - , bool wordwrap // 自动换行 - , float preferred // 自动换行区域大小 + const UnicodeString& str // 文本 + , Font* font // 字体 + , int pixelSize // 大小 + , int lineHeight // 行高 + , Color32 color32 // 颜色 + , ETextAnchor anchor // 锚点 + , ETextAlignment alignment // 对齐方式 + , bool wordwrap // 自动换行 + , float preferred // 自动换行区域大小 ){ s_TextInfos.clear(); diff --git a/Runtime/GUI/UITextMesh.h b/Runtime/GUI/UITextMesh.h index f09cce7..c298cb0 100644 --- a/Runtime/GUI/UITextMesh.h +++ b/Runtime/GUI/UITextMesh.h @@ -27,11 +27,8 @@ enum ETextAlignment { TextAlignment_Right, }; -typedef unsigned long long TextMeshHash; - namespace TextHelper { - TextMeshHash GetTextMeshHash(); } class UITextMesh @@ -44,6 +41,7 @@ public: void Draw(); private: + unsigned long long m_NotUniqueHash; Font* m_Font; std::unordered_map m_VBOs; -- cgit v1.1-26-g67d0