Skip to content
/ injector Public

A library for libgdx based application that injects object at runtime.

License

Notifications You must be signed in to change notification settings

Dgzt/injector

Repository files navigation

Injector

license


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.


Including in Project

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"
}

Usage

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!

About

A library for libgdx based application that injects object at runtime.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages