Code: Select all
local step = 0
local text = "this is a random text"
function love.load()
love.graphics.setNewFont(30)
end
function love.update(dt)
step = math.min(step + 20 * dt, #text)
end
function love.draw()
local sub = string.sub(text, 1, step)
love.graphics.print(sub, 100, 100)
end
Code: Select all
local step = 0
local text = "this is á random text"
function love.load()
love.graphics.setNewFont(30)
end
function love.update(dt)
step = math.min(step + 20 * dt, #text)
end
function love.draw()
local sub = string.sub(text, 1, step)
love.graphics.print(sub, 100, 100)
end
Code: Select all
Error
main.lua:15: UTF-8 decoding error: Not enough space
Traceback
[C]: in function 'print'
main.lua:15: in function 'draw'
[C]: in function 'xpcall'