Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
κoωo (kowo-lib)

κoωo (kowo-lib)

Fancy™ kotlin syntax for oωo-lib

774
3
Library
κoωo (kowo-lib) has been archived. κoωo (kowo-lib) will not receive any further updates unless the author decides to unarchive the project.
AboutGalleryChangelogVersions

Icon

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)

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.21
1.20.5–1.20.6

Platforms

Fabric
Quilt

Supported environments

Client and server

Links

Report issues View source

Creators

BonfireMC
BonfireMCOrganization

mazik
mazik Developer

Details

Licensed MIT
Published last year
Updated 7 months ago

Modrinth is open source.

main@599f23c

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.