new primitive: ly.putLabel()

This commit is contained in:
RadsammyT 2026-06-17 15:58:14 -04:00
commit d2d7a55e1a
No known key found for this signature in database
2 changed files with 39 additions and 0 deletions

View file

@ -22,6 +22,9 @@
--
-- For the byte argument, you may use string.byte to fill this argument.
--
-- putLabel(str, fg, bg, x, y) -- Draw text in argument str. See putCell()
-- for info on the rest of the arguments.
--
-- clock() -- The time, in microseconds.
-- }
--
@ -69,6 +72,7 @@ for i = 1, SQUARE_COUNT do
end
local timer = ly.clock()
local perf = ly.clock()
function draw()
-- Rather than progressing the animation by frame, do it based on
@ -105,4 +109,9 @@ function draw()
end
end
end
local new_perf = ly.clock()
local str = "FT: "..((new_perf - perf) / 1000).."ms"
ly.putLabel(str , 0x00FFFFFF, 0, (ly.width/2) - (string.len(str)/2), ly.height-1)
perf = new_perf
end