MonitoringMinecraft MonitoringMinecraft
T

talium

Мод Fabric

Talium is a library that aims to simplify creating GUIs and its components in minecraft

0 скачиваний 0 подписчиков
Оцените первым

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.

Смотри также

Похожие подборки моды — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
1845 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
CLOUDWORLD
3 онлайн
1.16.5 — 1.21.11 версия
Пвп, Арены, Дуэли, Кейсы, донаты, /free, приваты, спавн,
Battle Mine
Battle Mine Java + BE
8 онлайн
1.21.4 — 26.2 версия
ОТКРЫТИЕ! 20 + различных ивентов, 10+ различных боссов, много интересных механник
MigosMc
MigosMc Java + BE
1672 онлайн
1.8 — 26.2 версия
🌿 MigosMc.net | Гриферский сервер с войс-чатом | Награды за онлайн ⭐ ВЫЖИВАНИЕ⭐ ОДИНБЛОК⭐ МИНИ-ИГРЫ
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.8. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат