aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/config/JAnyHud.kt
blob: 5470f9bbfc2e4ddcf7288f831687805a82ce0658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package moe.nea.firmament.gui.config

import moe.nea.jarvis.api.JarvisHud
import moe.nea.jarvis.api.JarvisScalable
import kotlinx.serialization.Serializable
import net.minecraft.text.Text

@Serializable
data class HudPosition(
    var x: Double,
    var y: Double,
    var scale: Float,
)


data class HudMeta(
    val position: HudPosition,
    private val label: Text,
    private val width: Int,
    private val height: Int,
) : JarvisScalable, JarvisHud {
    override fun getX(): Double = position.x

    override fun setX(newX: Double) {
        position.x = newX
    }

    override fun getY(): Double = position.y

    override fun setY(newY: Double) {
        position.y = newY
    }

    override fun getLabel(): Text = label

    override fun getWidth(): Int = width

    override fun getHeight(): Int = height

    override fun getScale(): Float = position.scale

    override fun setScale(newScale: Float) {
        position.scale = newScale
    }

}