This repository was archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Input
DLPS edited this page Nov 21, 2023
·
3 revisions
Updated 21.11.2023
The input system in IceCore is inspired by Unreal Engine. You create input actions, and add triggers to them.
Every InputTrigger has a button and multiplier associated with it. The multiplier can be used for things like movement to make the Up-arrow to move the player up and the Down-arrow to move down.
Every InputAction has these four (4) variables
-
InputType, of typeEInputType- Can be either
AnalogorDigital- "Analog" input actions invoke their delegate (if they have one) each update
- "Digital" input actions invoke their delegate (if they have one) when their value changes. (Either none of the triggers are active, or at least one of them is)
- Can be either
-
InputTriggers, of typeList<InputTrigger>- These are what actually trigger this action, an action by itself does nothing.
- For "analog" actions every trigger is summed up with its multiplier applied
- For "digital" actions triggers are iterated through until one is active.
- Multiplier is not used
-
Active, of typebool- An active action is checked each update
- Inactive action aren't checked and will never invoke their delegate
-
Value, of typefloat- For "analog" actions this can be practically anything from
-23.5to1or97826.4 - For "digital" actions this is either 0 or 1
- For "analog" actions this can be practically anything from
Every InputAction can also have a InputUpdateDelegate of type InputDelegate that is called
- Every update for "analog" actions
- When the value changes for "digital" actions
Updates inputs
Updates all active input actions and invokes their delegate, if they have one and if it's necessary.Converts an input to it's float value
input = Key or mouse button
Returns float that is either 0, 1 or almost anything for the scrollwheel