talium
Talium is a library that aims to simplify creating GUIs and its components in minecraft
介绍
talium
Talium is a library that aims to simplify creating GUIs and its components in minecraft
Position/Size
one thing to note is that every position and size is in percent based on the screen and gui scale, it attempts to fit properly regardless of resolution (though falling short in some cases).
the size and position are relative to the parent so for example if you do x = 17 while it has a parent (meaning you either did addChild or parent = component) it will use the parent’s position as a base and then add that into the equation
example
component1 = background(x = 10%)
component2 = main(x = 15%, parent = background)
then component2 will be x = 10% + 15% then be calculated into pixels (although it is calculated into pixels earlier on but for the sake of keeping this a bit simpler lets just imagine it does this)
example (docs coming soon probably)
first we create a background component which will be the root parent
private val background = UIRect(0.0, 0.0, 100.0, 100.0)
then we can start creating mutliple components inside of that root component that will be displayed (you must set the parent to the background one or call addChild inside it)
private val main = UIRect(17.5, 17.5, 65.0, 65.0, parent = background).apply {
setColor(java.awt.Color.GREEN)
}
inside your Screen you should override these methods so that the components know what’s going on (might have a UIScreen class in the future that does this for you)
override fun extractRenderState(graphics: GuiGraphicsExtractor, mouseX: Int, mouseY: Int, a: Float) {
super.extractRenderState(graphics, mouseX, mouseY, a)
background.draw()
}
override fun charTyped(characterEvent: CharacterEvent): Boolean {
background.handleCharType(characterEvent.codepoint, characterEvent.codepointAsString(), -1)
return super.charTyped(characterEvent)
}
override fun keyPressed(keyEvent: KeyEvent): Boolean {
background.handleKeyInput(keyEvent.key, keyEvent.scancode)
return super.keyPressed(keyEvent)
}
annd your first gui with talium is done.
常见问题
talium 支持哪些 Minecraft 版本?
talium 支持 Minecraft Java 版 26.2,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
talium 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅客户端。
Synnerz 的其他作品
查看全部 →
devonian – hypixel skyblock
Devonian 是一个 Minecraft 模组,专注于增强你在游玩 Hypixel Skyblock 时的游戏体验。它添加了各种便利性功能,让你在游戏过程中获得更好的体验。
ctjs
An in-progress rewrite of the ChatTriggers mod in Fabric 1.21
noresourcepack
Hypixel skyblock added a new forced texture pack, this removes the "forced" part
barrl
Barrl is a fabric rendering specialized in 3D for minecraft 1.21.x
评论
登录后评论和评分