aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-26 21:05:20 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-26 21:05:20 +0200
commitddbf374e9302ae47d43aa981c0caf33a264b2496 (patch)
tree1e5f4dc18170060d204164373f2261b14f0f8e8d /src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
parentd3e2991644880b2766d9d50b7419466ece9027c1 (diff)
downloadskyhanni-ddbf374e9302ae47d43aa981c0caf33a264b2496.tar.gz
skyhanni-ddbf374e9302ae47d43aa981c0caf33a264b2496.tar.bz2
skyhanni-ddbf374e9302ae47d43aa981c0caf33a264b2496.zip
added summoning mob features
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
index 9de886f37..39c7217f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
@@ -409,7 +409,7 @@ object RenderUtils {
return lastValue + (currentValue - lastValue) * multiplier
}
- fun Position.renderString(string: String) {
+ fun Position.renderString(string: String, offsetY: Int = 0) {
if (string == "") return
val textToRender = "§f$string"
@@ -421,14 +421,21 @@ object RenderUtils {
val offsetX = (200 - renderer.getStringWidth(textToRender.removeColor())) / 2
val x = getAbsX(resolution, 200) + offsetX
- val y = getAbsY(resolution, 16)
-
-
+ val y = getAbsY(resolution, 16) + offsetY
GlStateManager.translate(x + 1.0, y + 1.0, 0.0)
renderer.drawStringWithShadow(textToRender, 0f, 0f, 0)
-
GlStateManager.popMatrix()
}
+
+ fun Position.renderStrings(list: List<String>) {
+ if (list.isEmpty()) return
+
+ var offsetY = 0
+ for (s in list) {
+ renderString(s, offsetY)
+ offsetY += 14
+ }
+ }
} \ No newline at end of file