From b76ffd5ce3e181d23988fc3bd41c30edd84457a9 Mon Sep 17 00:00:00 2001 From: inglettronald Date: Sun, 23 Jul 2023 10:24:53 -0500 Subject: wip --- .../com/dulkirfabric/util/render/HudElement.kt | 57 ++++++++++++++++++++++ .../util/render/HudElementDefaultPositionings.kt | 8 +++ 2 files changed, 65 insertions(+) create mode 100644 src/main/kotlin/com/dulkirfabric/util/render/HudElement.kt create mode 100644 src/main/kotlin/com/dulkirfabric/util/render/HudElementDefaultPositionings.kt (limited to 'src/main/kotlin/com/dulkirfabric/util/render') 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) +) -- cgit