The BindingBuilder class is used to create bindings and calls all the other classes. BindingBuilder contains 3 functions for you to use: CreateBinding, CreateOneAxisBinding, CreateTwoAxisBinding.

CreateBinding is used to create your initial PlayerActions. The first argument will always be a string, this will be the name of the binding, it will also be what shows up in the options menu. It can contain spaces. Then you will pass in the default bindings you want for this whether it be a key on a keyboard, a button on a controller, a button on your mouse, or an array of binding sources. It will then return a PlayerAction, make sure to keep this in a variable.

for example, this might be used like so: BindingBuilder.CreateBinding("Die", InControl.Key.P);

CreateOneAxisBinding is used to create a binding that can smoothly move between a positive and negative value. This is done by creating two PlayerActions using CreateBinding and passing them as arguments into CreateOneAxisBinding, one that will be a positive value, and the other that will be negative.

for example, this might be used like so:

speedUp = BindingBuilder.CreateBinding("Speed Up", defaultmouse:InControl.Mouse.PositiveScrollWheel);
speedDown = BindingBuilder.CreateBinding("Speed Down", defaultmouse:InControl.Mouse.NegativeScrollWheel);
//creates the one axis input control
speed = BindingBuilder.CreateOneAxisBinding(speedDown, speedUp);

CreateTwoAxisBinding is exactly the same as as CreateOneAxisBinding but you need positiveX, negativeX, positiveY, etc.

Last updated