add fps util for pxl8 in lua

This commit is contained in:
asrael 2025-11-11 23:26:51 -06:00
parent 7dd32ec453
commit 5637fa18c8
9 changed files with 57 additions and 76 deletions

View file

@ -1,5 +1,6 @@
local ffi = require("ffi")
local C = ffi.C
local game = _pxl8_game
local gfx = _pxl8_gfx
local input = _pxl8_input
local ui = _pxl8_ui
@ -46,6 +47,10 @@ function pxl8.sprite(id, x, y, w, h, flip_x, flip_y)
C.pxl8_sprite(gfx, id or 0, x or 0, y or 0, w or 16, h or 16, flip_x or false, flip_y or false)
end
function pxl8.get_fps()
return C.pxl8_game_get_fps(game)
end
function pxl8.get_width()
return C.pxl8_gfx_get_width(gfx)
end