Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local spaceTable = {"i" = -1}
- local lgprint = love.graphics.print
- function love.graphics.print(t, x, y)
- local font = love.graphics.getFont()
- local last = {size = 0, off = false, t = ""}
- for i = 1, string.len(t) do
- local v = string.sub(t, i, i)
- if spaceTable[v] then
- if not last.off then
- last.off = spaceTable[v]
- else
- last.off = last.off+spaceTable[v]
- end
- last.size = font:getWidth(string.sub(t, 1, i-1))
- if last.t ~= "" then
- lgprint(last.t, x+last.size+last.off, y)
- end
- last.t = v
- else
- last.t = last.t .. v
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement