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 VirtualButtons. 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
VirtualButtonhas 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 theRiseTimeproperty. - The
DeadZoneproperty helps eliminating analog joystick jitter. Any value belowDeadZoneis registered as zero. - The
DirectionSnapproperty 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.slnsolution. - Copy
InputPlugin.core.dllandInputPlugin.core.pdbfromSource\Code\CorePlugin\bin\Debugto thePluginsfolder of your Duality project.
- In Dualitor open the package manager window from the
Filemenu. - Select the
Online repositoryoption from the combobox labeledView, and from the list chooseInputPlugin. - Click
InstallthenApply. 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.
