From 72812a7b47f90f9460e54e8149ba9199a7841244 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Nov 2021 19:44:01 +0800 Subject: ! Text mesh done --- Runtime/Scripting/GUI/Font.bind.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Runtime/Scripting/GUI/Font.bind.cpp') 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* 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; } -- cgit v1.1-26-g67d0