I’m deving dialogue UI which display characters one by one with given delay and text.
the issue here is the “display.newText” blinks when updating UTF8 characters in simulator.
( using macOS Big Sur v11.7.1 )
Here is the code:
local _testStr = "♡ 你好,World ♡"
-- local _testStr = "こんにちは World"
-- local _testStr = "헬로 World"
local _textLen = string_len( _testStr )
local _opt = {
text = "",
x = display.contentCenterX,
y = display.contentCenterY,
width = 420,
fontSize = 48,
align = "left",
}
local _ttfText = display.newText(_opt)
local _cnt = 1;
timer.performWithDelay( 200,
function()
_cnt = _cnt + 1
_ttfText.text = string.sub( _testStr, 1, math.min( _cnt, _textLen ))
end,100
)
is there any solution to fix this? thanks in advance.