1 dofile("textrender.lua");
12 keys
.RCTRL
= 128 + 29;
18 print("Loading font...");
19 font
, err
= io
.open_arch_read("unifont.jrsr");
21 error("Can't open font: " .. err
);
24 print("Font loaded.");
28 jpcrr
.hud
.top_gap(3, 60);
29 render_text(3, 0, 0, "Timestamp: " .. tostring(jpcrr
.clock_time()), false, 255, 255, 0);
31 for k
, v
in pairs(keys
) do
32 if jpcrr
.keypressed(v
) then
33 render_text(3, index
* 8, 20, k
, false, 255, 255, 0);
35 index
= index
+ #k
+ 1;
37 if jpcrr
.joystick_state
then
38 hA
, hB
, hC
, hD
, bA
, bB
, bC
, bD
= jpcrr
.joystick_state();
40 render_text(3, 0 * 8, 40, false, "<Joystick status not available>", false, 255, 255, 0);
44 render_text(3, 0 * 8, 40, "X", false, 255, 255, 0);
47 render_text(3, 2 * 8, 40, tostring(hA
), false, 255, 255, 0);
51 render_text(3, 16 * 8, 40, "X", false, 255, 255, 0);
54 render_text(3, 18 * 8, 40, tostring(hB
), false, 255, 255, 0);
58 render_text(3, 32 * 8, 40, "X", false, 255, 255, 0);
61 render_text(3, 34 * 8, 40, tostring(hC
), false, 255, 255, 0);
65 render_text(3, 48 * 8, 40, "X", false, 255, 255, 0);
68 render_text(3, 50 * 8, 40, tostring(hD
), false, 255, 255, 0);