diff options
author | chai <chaifix@163.com> | 2021-11-05 09:39:41 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-05 09:39:41 +0800 |
commit | be9870f5c1ba4f6ae8cd9764f1a8ed56ee81ddd5 (patch) | |
tree | 941580ae1480584eed3c9c8c6bfb6ccec847fe65 | |
parent | 50dfa4050343a25a5a34816cc276ec6ec9cf33ce (diff) |
*misc
-rw-r--r-- | Runtime/GUI/TextMeshGenerator.cpp | 10 | ||||
-rw-r--r-- | Runtime/GUI/TextMeshGenerator.h | 2 | ||||
-rw-r--r-- | Runtime/GUI/UITextMesh.cpp | 18 | ||||
-rw-r--r-- | Runtime/GUI/UITextMesh.h | 4 |
4 files changed, 21 insertions, 13 deletions
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<TextMeshGenerator>
{
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<UITextMesh*> 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<int/*IndexOfAtlas*/, VertexBuffer*> m_VBOs; |