diff options
author | Linnea Gräf <nea@nea.moe> | 2024-10-19 18:20:55 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-10-19 18:20:55 +0200 |
commit | 5aa969979ab1dd0e64e5b569cc3b7b281b3e536f (patch) | |
tree | 55a7b8029dc76fd44078bca056fe31ac2f76833b /src/main/kotlin/gui | |
parent | 3d7ace2e0fd66a2c83222d35331b27783268deea (diff) | |
download | ultra-notifier-master.tar.gz ultra-notifier-master.tar.bz2 ultra-notifier-master.zip |
Diffstat (limited to 'src/main/kotlin/gui')
-rw-r--r-- | src/main/kotlin/gui/MessageUi.kt | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/main/kotlin/gui/MessageUi.kt b/src/main/kotlin/gui/MessageUi.kt index f4012da..f3feeb7 100644 --- a/src/main/kotlin/gui/MessageUi.kt +++ b/src/main/kotlin/gui/MessageUi.kt @@ -1,29 +1,19 @@ package moe.nea.ultranotifier.gui -import gg.essential.universal.UGraphics import gg.essential.universal.UMatrixStack import gg.essential.universal.UScreen +import moe.nea.ultranotifier.util.render.ScreenRenderUtils +import moe.nea.ultranotifier.util.ultraIdentifier import java.awt.Color class MessageUi : UScreen() { override fun onDrawScreen(matrixStack: UMatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float) { super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks) - fillRect(matrixStack, - 0.0, 0.0, width.toDouble(), height.toDouble(), Color.RED) + ScreenRenderUtils.fillRect(matrixStack, 0.0, 0.0, width.toDouble(), height.toDouble(), Color.RED) + ScreenRenderUtils.renderTexture( + ultraIdentifier("textures/gui/square_panel.png"), + matrixStack, + 200.0, 0.0, 300.0, 100.0 + ) } - - fun fillRect( - matrixStack: UMatrixStack, - left: Double, top: Double, right: Double, bottom: Double, - color: Color, - ) { - val buffer = UGraphics.getFromTessellator() - buffer.beginWithDefaultShader(UGraphics.DrawMode.QUADS, UGraphics.CommonVertexFormats.POSITION_COLOR) - buffer.pos(matrixStack, left, top, 0.0).color(color).endVertex() - buffer.pos(matrixStack, left, bottom, 0.0).color(color).endVertex() - buffer.pos(matrixStack, right, bottom, 0.0).color(color).endVertex() - buffer.pos(matrixStack, right, top, 0.0).color(color).endVertex() - buffer.drawDirect() - } - } |