summaryrefslogtreecommitdiff
path: root/Runtime/Scripting/GUI
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-02 19:44:01 +0800
committerchai <chaifix@163.com>2021-11-02 19:44:01 +0800
commit72812a7b47f90f9460e54e8149ba9199a7841244 (patch)
tree9ebdb4b65d7cbbc0a3d7c436a9b45d4eff351b62 /Runtime/Scripting/GUI
parentb7511abf1a1f302b5c7ebf50faaf65b62d7bb6ed (diff)
! Text mesh done
Diffstat (limited to 'Runtime/Scripting/GUI')
-rw-r--r--Runtime/Scripting/GUI/Font.bind.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Runtime/Scripting/GUI/Font.bind.cpp b/Runtime/Scripting/GUI/Font.bind.cpp
index 8259a60..733fcf1 100644
--- a/Runtime/Scripting/GUI/Font.bind.cpp
+++ b/Runtime/Scripting/GUI/Font.bind.cpp
@@ -5,6 +5,7 @@
#include "Runtime/Common/DataBuffer.h"
#include "Runtime/GUI/utf8.h"
#include "Runtime/Utilities/StaticInitiator.h"
+#include "Runtime/GUI/TextMesh.h"
static std::vector<character::Codepoint>* s_Codepoints;
@@ -127,6 +128,15 @@ LUA_BIND_IMPL_METHOD(Font, _GetCharacters)
self->RenderCharacters(*s_Codepoints, size);
+ UnicodeString str;
+ str.str = s_Codepoints->data();
+ str.length = s_Codepoints->size();
+
+ WipeGLError();
+
+ TextMesh* tm = new TextMesh(str, self, size, ETextAnchor::TextAnchor_MiddleLeft, ETextAlignment::TextAlignment_Left);
+ tm->Draw();
+
return 0;
}