Skip to content

Commit 4e61f95

Browse files
committed
feat: create helper constructor to easily use percentages
[no ci]
1 parent 50f8a81 commit 4e61f95

File tree

1 file changed

+3
-0
lines changed
  • mod/src/main/kotlin/gg/skytils/skytilsmod/core/structure/v2

1 file changed

+3
-0
lines changed

mod/src/main/kotlin/gg/skytils/skytilsmod/core/structure/v2/HudElement.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ abstract class HudElement(
4141
constructor(name: String, x: Float, y: Float) :
4242
this(name, mutableStateOf(x / UResolution.scaledWidth), mutableStateOf(y / UResolution.scaledHeight))
4343

44+
constructor(name: String, x: Double, y: Double):
45+
this(name, mutableStateOf(x.toFloat()), mutableStateOf(y.toFloat()))
46+
4447
private val position = memo {
4548
Modifier.alignHorizontal(Alignment.Relative(x()))
4649
.alignVertical(Alignment.Relative(y()))

0 commit comments

Comments
 (0)