截图
介绍
中文介绍正在准备中,下面暂时显示原文。
![]()
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)
常见问题
κoωo (kowo-lib) 支持哪些 Minecraft 版本?
κoωo (kowo-lib) 支持 Minecraft Java 版 1.20.5–1.21.8,共 7 个版本,可用的加载器:Fabric / Quilt。下载时注意选择和你游戏版本一致的文件。
κoωo (kowo-lib) 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。
Bonfire Studios 的其他作品
查看全部 →Windy
by Bonfire Studios
为你的世界添加风粒子的客户端模组
149.6万
7 个月前
Modrinth
Polymer Font Utils
by Bonfire Studios
API for generating font files
2,106
1 年前
Modrinth
Simple Radio Re-Created
by Bonfire Studios
Redesigns the Simple Radio mod in the style of the Create mod.
1,824
1 年前
Modrinth
BlockFront Ukrainian
by Bonfire Studios
Ukrainian translation for BlockFront
135
1 个月前
Modrinth
评论
登录后评论和评分