aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/util/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/util/render')
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt57
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt8
2 files changed, 65 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt b/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt
new file mode 100644
index 0000000..824c745
--- /dev/null
+++ b/src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt
@@ -0,0 +1,57 @@
+package com.dulkirfabric.util.render
+
+import kotlinx.serialization.Serializable
+import moe.nea.jarvis.api.JarvisHud
+import moe.nea.jarvis.api.JarvisScalable
+import net.minecraft.text.Text
+
+class HudElement (var positioning: Positioning,
+ private val label: Text,
+ private val width: Int,
+ private val height: Int
+ ): JarvisHud, JarvisScalable {
+
+ @Serializable
+ data class Positioning(
+ var x: Double,
+ var y: Double,
+ var scale: Float
+ )
+
+ override fun getX(): Double {
+ return positioning.x
+ }
+
+ override fun setX(newX: Double) {
+ positioning.x = newX
+ }
+
+ override fun getY(): Double {
+ return positioning.y
+ }
+
+ override fun setY(newY: Double) {
+ positioning.y = newY
+ }
+
+ override fun getLabel(): Text {
+ return label
+ }
+
+ override fun getWidth(): Int {
+ return width
+ }
+
+ override fun getHeight(): Int {
+ return height
+ }
+
+ override fun getScale(): Float {
+ return positioning.scale
+ }
+
+ override fun setScale(newScale: Float) {
+ positioning.scale = newScale
+ }
+
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt b/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt
new file mode 100644
index 0000000..9d27158
--- /dev/null
+++ b/src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt
@@ -0,0 +1,8 @@
+package com.dulkirfabric.util.render
+
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class HudElementDefaultPositionings(
+ var fooPos: HudElement.Positioning = HudElement.Positioning(.1, .1, 1f)
+)