Keyboard abstraction plugin for Duality game engine
is a Component
which enables the user to query the status of the VirtualButtons
defined in the InputMapping
. There is an extension method to easily grab a reference to the InputManager
in the Scene.
There can be only one InputManager
in the Scene.
Example:
float horizontalAxis = this.InputManager().GetAxis("Horizontal");
bool isVerticalPressed = this.InputManager().IsButtonPressed("Vertical");
is a Resource
which lets you define a dictionary of string identifiers and VirtualButton
s. It is editable through the Object Inspector.
has zero or more positive keys and negative keys which can be keyboard keys, mouse buttons, gamepad buttons or gamepad axes. If any of them is hit/pressed/released in the current frame, InputManager
queries will reflect that.
- Each
VirtualButton
has a current axis value between -1 and 1. Positive keys drive the axis value to 1 while negative keys drive it to -1, according to theRiseTime
property. - The
DeadZone
property helps eliminating analog joystick jitter. Any value belowDeadZone
is registered as zero. - The
DirectionSnap
property if enabled, lets the axis value immediately jump to 0 when the input direction is changed.
InputPlugin.core.dll
assembly has to be referenced from the game plugin's project to use the InputPlugin in your game!
- Clone the repository
- Build the
Source\Code\ProjectPlugins.sln
solution. - Copy
InputPlugin.core.dll
andInputPlugin.core.pdb
fromSource\Code\CorePlugin\bin\Debug
to thePlugins
folder of your Duality project.
- In Dualitor open the package manager window from the
File
menu. - Select the
Online repository
option from the combobox labeledView
, and from the list chooseInputPlugin
. - Click
Install
thenApply
. These operations will download the plugin from nuget.org, and restart Dualitor with these changes.
The code is under MIT license, details in the license file. Icons used from the fatcow.com collection under CC-BY-3.0 US.