diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt index f5d09e0..f656c41 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt @@ -1,12 +1,19 @@ package fr.username404.snowygui.gui +import com.mojang.blaze3d.vertex.BufferBuilder import com.mojang.blaze3d.vertex.PoseStack +import com.mojang.blaze3d.vertex.Tesselator fun interface Renderable { fun render(poseStack: PoseStack?) } abstract class Element( var x: Int, var y: Int, val width: Int, val height: Int ): Renderable { + companion object { + @JvmStatic protected val tessellator: Tesselator = Tesselator.getInstance() + @JvmStatic protected val buffer: BufferBuilder = tessellator.builder + const val BaseColor: Int = -0x1 + } fun display(stack: PoseStack? = null) { if (!hidden) render(stack) } var hidden: Boolean = false } \ No newline at end of file diff --git a/common/src/main/kotlin/fr/username404/snowygui/rendering/Util.kt b/common/src/main/kotlin/fr/username404/snowygui/rendering/Util.kt deleted file mode 100644 index ef4b71a..0000000 --- a/common/src/main/kotlin/fr/username404/snowygui/rendering/Util.kt +++ /dev/null @@ -1,14 +0,0 @@ -package fr.username404.snowygui.rendering - -import com.mojang.blaze3d.vertex.BufferBuilder -import com.mojang.blaze3d.vertex.PoseStack -import com.mojang.blaze3d.vertex.Tesselator -import net.minecraft.client.Minecraft - -internal object Util { - private val tessellator: Tesselator = Tesselator.getInstance() - private val buffer: BufferBuilder = tessellator.builder - fun UIString(poseStack: PoseStack, string: String, i: Float, j: Float) { - Minecraft.getInstance().font.draw(poseStack, string, i, j, 10) - } -} \ No newline at end of file