#monogame #library #input #gamedev

Jean-David Moisan dd36d9538a Comments are too fat 6 years ago
Images 5d30e4ec30 Initial commit 6 years ago
Source dd36d9538a Comments are too fat 6 years ago
docs d229815e61 Update docs 6 years ago
.gitignore 150a094250 Added .gitignore 6 years ago
LICENSE efd81915b7 Initial commit 6 years ago
README.md ed36c4bf04 Readme corrections 6 years ago

README.md

Apos.Gui

Input library for MonoGame.

Discord

Documentation

Build

NuGet NuGet NuGet

Features

  • Mouse, Keyboard, GamePad buttons

Usage samples

In your game's Initialize(), pass the game class to InputHelper.Game:

protected override void Initialize() {
    InputHelper.Game = this;
}

In your game's Update(GameTime gameTime), call the two functions:

protected override void Update(GameTime gametime) {
    //Call UpdateSetup at the start.
    InputHelper.UpdateSetup();

    //...

    //Call UpdateCleanup at the end.
    InputHelper.UpdateCleanup();
}
//Create a condition to toggle fullscreen.
//It should work on both Alt keys and Enter.
var toggleFullScreen = new ConditionComposite();
toggleFullscreen.AddSet(Keys.Enter).AddNeed(Keys.LeftAlt);
toggleFullscreen.AddSet(Keys.Enter).AddNeed(Keys.RightAlt);

//To check if toggleFullscreen is triggered:
if (toggleFullscreen.Pressed()) {
    //Do the fullscreen change.
}