From c712bf662c0eb2aaf9bcd91f41e9c61ecfc608e6 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:42:52 -0500 Subject: [PATCH] add spartan readme --- readme.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..108f4a1 --- /dev/null +++ b/readme.md @@ -0,0 +1,25 @@ +# api + +note: supports all keys minetest does + +```lua +controls.register_on_press(function(player, key) + -- called on key down + -- @player: player object + -- @key: key pressed +end) + +controls.register_on_hold(function(player, key, length) + -- called while key is held + -- @player: player object + -- @key: key pressed + -- @length: length of time key was held in seconds +end) + +controls.register_on_release(function(player, key, length) + -- called on key up + -- @player: player object + -- @key: key pressed + -- @length: length of time key was held in seconds +end) +``` \ No newline at end of file