I’ve been trying to reproduce a typing effect that you find in many older console based RPG’s. I’ve attempted a few different approaches but can’t seem to get it. Could anyone offer any advice? Thanks!
local function loadWords(s) local temp = {} for word in string.gmatch(s, "[^%s]+") do table.insert(temp, word) end return temp end local function updateDialog(dialog, str) dialog.text = dialog.text .. " " .. str end local function displayWords(dialog, words) for i = 1, #words do dialog.text = dialog.text .. " " .. words[i] local step = 250 timer.performWithDelay(2000 + step \* i, updateDialog(dialog, words[i])) end end local myText = display.newText( "", 200, 200, native.systemFont, 22 ) local t = loadWords("Here is some text!") displayWords(myText, t)