Hi!
I was trying to create RPG-styled dialogue class, like here:
Easiest solution I was thinking about:
local function sayPhrase(textfield_ID, phrase)
for i=1, #phrase do
textfield_ID:setText(string.sub(phrase,1,i))
Core.yield(0.06)
end
end
Core.asyncCall(sayPhrase, eng_textfield, "Hi there! My name is Alice!") |
But for some reason non-english characters rendering is extremely slow, textfield is blinking when we use simple "setText" method:
https://media.giphy.com/media/uVgrXuDnBtzMDzijqc/giphy.gifgproj with replicated issue:
https://www.dropbox.com/s/wvvrxr655akpse5/test_FontRendering.zip?dl=0(I've tested both Font.new, TTFont.new, and different system fonts;
with Core.asyncCall and with Timers
in both desktop&mobile players, and in exported apk)
I've already asked about RPG-styled dialogues before,
@antix had another solution,
using Rendertarget.
But this method doesn't work for non-english characters.
I'm thinking about covering text with Pixel, then gradually decrease Pixel's width from left to right so characters will be gradually uncovered.
How would you solve it?
Comments
Likes: Apollo14, SinisterSoft, antix
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Just replaced word 'string.sub' with 'utf8.sub', it works perfectly!
Thx!
Likes: antix
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)