Skip to content

Commit

Permalink
Update documentation about InputStates change
Browse files Browse the repository at this point in the history
  • Loading branch information
enginmanap committed Jan 14, 2019
1 parent 0005e49 commit 9aa86bf
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/ExtendingByAPI/implementPlayerExtension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ______________________________
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
| |:ref:`PlayerExtensionInterface(LimonAPI \*limonAPI)<PlayerExtensionInterface-PlayerExtensionInterface>` |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
| void |:ref:`processInput(InputHandler &inputHandler, long time)<PlayerExtensionInterface-processInput>` |
| void |:ref:`processInput(const InputStates &inputState, long time)<PlayerExtensionInterface-processInput>` |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
| bool |:ref:`interact(std::vector\<LimonAPI::ParameterRequest\> &parameters)<PlayerExtensionInterface-interact>` |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
Expand All @@ -30,7 +30,7 @@ The constructor of the interface.

.. _PlayerExtensionInterface-processInput:

void processInput(InputHandler &inputHandler, long time)
void processInput(const InputStates &inputState, long time)
=======================================================

Called each frame with updated input information, and time of frame in milliseconds.
Expand All @@ -52,6 +52,17 @@ Returns the name of the Player Extension.
.. warning::
The name must be unique, or the results will be undefined.

.. _ActorInterface-InputStatesUsage:

InputStates Class Usage
_______________________

InputStates is a thin wrapper around SDL2 input events. It has 4 main methods that can be used:
getInputStatus: Allows checking if a key is down or up, for keys used by engine. 3 buttons of mouse is included.
getInputEvents: Allows if a key state changed in last frame, for keys used by engine. 3 buttons of mouse is included.
getRawKeyStates: Allows to check all key states for current frame.
getMouseChange: Allows checking for relative or absolute position of the mouse, depending of the mode(Menu player uses absolute).

.. _ActorInterface-enableDynamicDiscovery:

How to enable Dynamic Library discovery
Expand All @@ -66,4 +77,4 @@ This method should fill the actorMap passed, with all the custom actors, like th
::

(*playerExtensionMap)["$EXTENSION_NAME1$"] = &createPlayerExtension<$ExtensionClass1$>;
(*playerExtensionMap)["$EXTENSION_NAME2$"] = &createPlayerExtension<$ExtensionClass2$>;
(*playerExtensionMap)["$EXTENSION_NAME2$"] = &createPlayerExtension<$ExtensionClass2$>;

0 comments on commit 9aa86bf

Please sign in to comment.