Mindustry Assets#
The mindustryAssets extension allows you to configure assets,
including sprites, bundles, shaders, sounds and anything
you want to add into your mod.
Assume your project has this structure:
YourMod/
├─ assets/
│ ├─ bundles/
│ ├─ sprites/
├─ src/
│ ├─ example/
│ │ ├─ ExampleMod.java
├─ build.gradle
├─ gradle.properties
Simple usage#
Assets#
In most cases, you can just simply copy all files
recursively from the assets root folder into the jar task with this syntax:
mindustryAssets {
rootAt "$projectDir/assets"
}
import io.github.liplum.mindustry.*
mindustryAssets {
root at "$projectDir/assets"
}
Icon#
MGPP will automatically search for it by paths mentioned below orderly:
- projectDir/icon.png
- rootDir/icon.png
Also, you can configure it to any file/path your want.
mindustryAssets {
iconAt "$rootDir/icon.png"
}
import io.github.liplum.mindustry.*
mindustryAssets {
icon at "$rootDir/icon.png"
}
Advanced usage#
MGPP provides AssetBatchType and AssetBatch for generating resource class,
named R.java conventionally.
Due to rare use cases, please check its specific page for more information.