Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.
DLPS edited this page Nov 21, 2023 · 3 revisions

Updated 21.11.2023

How does input work in IceCore?

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 type EInputType
    • Can be either Analog or Digital
      • "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)
  • InputTriggers, of type List<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 type bool
    • An active action is checked each update
    • Inactive action aren't checked and will never invoke their delegate
  • Value, of type float
    • For "analog" actions this can be practically anything from -23.5 to 1 or 97826.4
    • For "digital" actions this is either 0 or 1

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

Functions

void UpdateInputs()

Updates inputs Updates all active input actions and invokes their delegate, if they have one and if it's necessary.

float ConvertInput(EInput input)

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

Clone this wiki locally