nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1#ifndef NANOMMO_CLIENT_INPUT_H_
2#define NANOMMO_CLIENT_INPUT_H_
3
4#include <raylib.h>
5
6#include <optional>
7
8namespace nanommo {
9
10/// Whether the player is typing into a text field, such as the chat's, which
11/// takes the keys from the game.
12bool Typing();
13
14/// x is to the right and z is towards the camera, each -1, 0 or 1.
15Vector3 Movement();
16
17bool Running();
18
19bool Attacking();
20
21/// Which of the number keys, from 1 to 9, went down this frame, as a slot
22/// from zero, or, with Shift held, from nine, for the row above.
23std::optional<int> HotbarKey();
24
25/// Whether the left button went down this frame on the world, and not on one
26/// of the GUI's windows.
27bool ClickedWorld();
28
29/// How far to turn the camera this frame, in radians: with Q and E, or the
30/// mouse, dragged with the right button down.
31float CameraTurn(float seconds);
32
33/// How far to tilt the camera this frame, in radians, up over the player or
34/// down towards the ground: with the mouse, dragged with the right button
35/// down.
36float CameraTilt();
37
38/// How much closer to bring the camera this frame, as a share of its
39/// distance, from the mouse wheel.
40float CameraZoom();
41
42} // namespace nanommo
43
44#endif // NANOMMO_CLIENT_INPUT_H_
Definition chat.cc:9
Vector3 Movement()
x is to the right and z is towards the camera, each -1, 0 or 1.
Definition input.cc:24
bool Running()
Definition input.cc:48
float CameraZoom()
Definition input.cc:97
bool Attacking()
Definition input.cc:52
float CameraTurn(float seconds)
Definition input.cc:73
bool Typing()
Definition input.cc:22
float CameraTilt()
Definition input.cc:89
bool ClickedWorld()
Definition input.cc:68
std::optional< int > HotbarKey()
Definition input.cc:54