mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
i pushed to the wrong repo ._. (#5)
* Hide crafting grid in player inventory * Put all the MTG stuff in a modpack --------- Co-authored-by: CrazyladMT <crazyladttd@outlook.com>
This commit is contained in:
parent
8ff3299dcc
commit
3728e0d29e
736 changed files with 1 additions and 0 deletions
35
mods/mtg/controls/readme.md
Normal file
35
mods/mtg/controls/readme.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Controls [controls]
|
||||
|
||||
[](https://github.com/mt-mods/controls/actions)
|
||||
[](https://content.minetest.net/packages/mt-mods/controls/)
|
||||
|
||||
Utility library for control press/hold/release events.
|
||||
|
||||
Rewritten and maintained version of [Arcelmi/minetest-controls](https://github.com/Arcelmi/minetest-controls).
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Callbacks are supported for all keys in `player:get_player_control()`.
|
||||
|
||||
```lua
|
||||
controls.register_on_press(function(player, key)
|
||||
-- Called when a key is pressed
|
||||
-- player: player object
|
||||
-- key: key pressed
|
||||
end)
|
||||
|
||||
controls.register_on_hold(function(player, key, length)
|
||||
-- Called every globalstep while a key is held
|
||||
-- player: player object
|
||||
-- key: key pressed
|
||||
-- length: length of time key has been held in seconds
|
||||
end)
|
||||
|
||||
controls.register_on_release(function(player, key, length)
|
||||
-- Called when a key is released
|
||||
-- player: player object
|
||||
-- key: key pressed
|
||||
-- length: length of time key was held in seconds
|
||||
end)
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue