The Quantum button used for player input. Instead of using bools or similar data types to represent key presses, the Button type is used inside the Input DSL definition. This is because it only uses one bit per instance, so it is favorable to use where possible. Although they only use one bit over the network, locally they will contain a bit more game state. This is because the single bit is only representative of whether or not the button was pressed during the current frame, the rest of the information is computed locally.
More...
|
override int | GetHashCode () |
| Overrides the default hash function. More...
|
|
override string | ToString () |
| Converts the numeric value of this instance to its equivalent string representation. More...
|
|
Button | Update (Int32 frame, Boolean state) |
| Updates the button state. This is called from the code-generated Quantum input methods. More...
|
|
|
const int | SIZE = 12 |
| The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More...
|
|
The Quantum button used for player input. Instead of using bools or similar data types to represent key presses, the Button type is used inside the Input DSL definition. This is because it only uses one bit per instance, so it is favorable to use where possible. Although they only use one bit over the network, locally they will contain a bit more game state. This is because the single bit is only representative of whether or not the button was pressed during the current frame, the rest of the information is computed locally.
◆ Update()
Button Quantum.Button.Update |
( |
Int32 |
frame, |
|
|
Boolean |
state |
|
) |
| |
|
inline |
Updates the button state. This is called from the code-generated Quantum input methods.
- Parameters
-
frame | New frame |
state | New button state |
- Returns
- The updated button.
◆ operator Boolean()
static implicit Quantum.Button.operator Boolean |
( |
Button |
k | ) |
|
|
inlinestatic |
◆ operator Button()
static implicit Quantum.Button.operator Button |
( |
Boolean |
k | ) |
|
|
inlinestatic |
Creates a button from the boolean value.
- Parameters
-
k | Creates configured button representing a recently pressed button |
◆ Serialize()
static void Quantum.Button.Serialize |
( |
Button * |
ptr, |
|
|
FrameSerializer |
serializer |
|
) |
| |
|
inlinestatic |
Serializes a Button into a FrameSerializer to write or read from a frame snapshot.
- Parameters
-
ptr | The pointer to the Button. |
serializer | The FrameSerializer instance into which the struct will be serialized. |
◆ ToString()
override string Quantum.Button.ToString |
( |
| ) |
|
|
inline |
Converts the numeric value of this instance to its equivalent string representation.
- Returns
- The string representation of the value of this instance
◆ GetHashCode()
override int Quantum.Button.GetHashCode |
( |
| ) |
|
|
inline |
Overrides the default hash function.
- Returns
- A hash code for the current object.
◆ SIZE
const int Quantum.Button.SIZE = 12 |
|
static |
The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.
◆ IsDown
Boolean Quantum.Button.IsDown |
|
get |
Is the button currently down.
◆ WasPressed
Boolean Quantum.Button.WasPressed |
|
get |
Was the button pressed this frame.
◆ WasReleased
Boolean Quantum.Button.WasReleased |
|
get |
Was the button released this frame.