Compatibility
Minecraft: Java Edition
1.21.5
1.21
1.20.5–1.20.6
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
Fancy™ kotlin syntax for oωo-lib
Setup
In your build.gradle
file, add these lines:
repositories {
maven { url "https://api.modrinth.com/maven" }
maven { url "https://maven.wispforest.io/releases" }
}
dependencies {
modImplementation include("maven.modrinth:kowo-lib:0.12.20b+1.21.5")
modImplementation "io.wispforest:owo-lib:0.12.20+1.21.5"
// only if you plan to use owo-config
// annotationProcessor "io.wispforest:owo-lib:0.12.20+1.21.5"
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
}
Example usage
import xyz.bonfiremc.kowo.dsl.*
class SizingTestKuwuScreen : BaseOwoScreen<FlowLayout>() {
override fun createAdapter(): OwoUIAdapter<FlowLayout> {
return OwoUIAdapter.create(this, ::verticalFlow)
}
override fun build(rootComponent: FlowLayout) {
root {
verticalAlignment = VerticalAlignment.CENTER
horizontalAlignment = HorizontalAlignment.CENTER
+stack(Sizing.content(), Sizing.content()).apply {
padding {
all(15)
}
horizontalAlignment = HorizontalAlignment.CENTER
surface = Surface.panelWithInset(6)
val animation: Animation<Sizing> = horizontalSizing().animate(500, Easing.CUBIC, 75.fill)
+button("initialize sizenite".literal).apply {
horizontalSizing = 50.fill
onPress {
animation.reverse()
}
}
}
+label("bruh".literal.styled { it.withClickEvent(ClickEvent.OpenUrl(URI.create("https://wispforest.io"))) })
}
}
}
More examples on GitHub
TODO
- [x] Simplified way to add child to parent component
- [ ] More examples
- [ ] Styling with MSS (Minecraft Style Sheets)