
com.kennycason.gdx.controller.mapping.ButtonMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-controller Show documentation
Show all versions of gdx-controller Show documentation
A library to help with controller management in LibGDX.
The newest version!
package com.kennycason.gdx.controller.mapping;
import com.badlogic.gdx.utils.ObjectMap;
import com.kennycason.gdx.controller.controls.Controls;
/**
* Created by kenny on 5/27/15.
*
* Button mappers are meant to abstract the underlying key codes (which are hard to memorize
* and keep track of to easy to remember enums.
*/
public class ButtonMapper {
private final ObjectMap mapping = new ObjectMap<>();
public ButtonMapper() {}
public void map(V control, Integer mapping) {
this.mapping.put(control, mapping);
}
public final Integer get(V control) {
return mapping.get(control, -1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy