A library for libgdx, an open-source game development application framework written in java.
Injector is a dependency injector what injects objects at runtime, uses reflection. It can create object with its dependencies.
To use this in your gradle project, add the version number and jitpack repository information to your root build.gradle file:
allprojects {
ext {
...
injectorVersion = '1.0.0'
}
repositories {
...
maven { url 'https://jitpack.io' }
}
}
And in your core project add the dependency:
dependencies {
implementation "com.github.Dgzt:injector:$injectorVersion"
}
Inject object:
YourComponent component = Injector.get(YourComponent.class);
Dispose injector in your main dispose method:
@Override
public void dispose () {
...
Injector.dispose();
}
Example application uses the Metal UI Skin created by Raymond "Raeleus" Buckley under the CC BY license. Check out the others!