mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-20 12:34:19 +02:00
new primitive: ly.putLabel()
This commit is contained in:
parent
7df3f9c3b2
commit
d2d7a55e1a
2 changed files with 39 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue