summaryrefslogtreecommitdiff
path: root/Runtime/Scripting
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Scripting')
-rw-r--r--Runtime/Scripting/GUI/Font.bind.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Runtime/Scripting/GUI/Font.bind.cpp b/Runtime/Scripting/GUI/Font.bind.cpp
index 7172027..e749303 100644
--- a/Runtime/Scripting/GUI/Font.bind.cpp
+++ b/Runtime/Scripting/GUI/Font.bind.cpp
@@ -88,15 +88,17 @@ LUA_BIND_IMPL_METHOD(Font, _GetCharacter)
return 1;
}
-// font:GetCharacter(str, size, encoding)
+// font:GetCharacter(str, size, wordwrap, preferredWidth, encoding)
LUA_BIND_IMPL_METHOD(Font, _GetCharacters)
{
LUA_BIND_PREPARE(L, Font);
- LUA_BIND_CHECK(L, "USN*");
+ //LUA_BIND_CHECK(L, "US");
char* buf = (char*)state.GetValue<const char*>(2, "");
int size = state.GetValue<int>(3, 12);
- int encoding = state.GetValue<int>(4, EEncoding::Encoding_UTF8);
+ bool wordwrap = state.GetValue<bool>(4, false);
+ float preferred = state.GetValue<float>(5, 0);
+ int encoding = state.GetValue<int>(6, EEncoding::Encoding_UTF8);
s_Codepoints->clear();
if (encoding == EEncoding::Encoding_UTF8)
@@ -134,7 +136,7 @@ LUA_BIND_IMPL_METHOD(Font, _GetCharacters)
WipeGLError();
- UITextMesh* tm = new UITextMesh(str, self, size, ETextAnchor::TextAnchor_MiddleLeft, ETextAlignment::TextAlignment_Left);
+ UITextMesh* tm = new UITextMesh(str, self, size, size + 3, TextAnchor_MiddleLeft, ETextAlignment::TextAlignment_Left, wordwrap, preferred);
tm->Draw();
return 0;