mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
bigger click hitbox for titlescreen uiremocon
This commit is contained in:
@@ -40,8 +40,8 @@ open class UIItemTextButton(
|
||||
val backgroundBlendMode: String = BlendMode.NORMAL,
|
||||
|
||||
|
||||
val preGapX: Int = 0,
|
||||
val postGapX: Int = 0,
|
||||
val paddingLeft: Int = 0,
|
||||
val paddingRight: Int = 0,
|
||||
|
||||
val alignment: Alignment = Alignment.CENTRE,
|
||||
val hitboxSize: Int = UIItemTextButton.height,
|
||||
@@ -109,9 +109,9 @@ open class UIItemTextButton(
|
||||
label,
|
||||
// "$label/H:${highlighted.toInt()}, M:${mouseUp.toInt()}",
|
||||
when (alignment) {
|
||||
Alignment.CENTRE -> posX.toFloat() + width.minus(textW).div(2) + (preGapX - postGapX).div(2)
|
||||
Alignment.LEFT -> posX.toFloat() + preGapX
|
||||
Alignment.RIGHT -> width - postGapX - textW.toFloat()
|
||||
Alignment.CENTRE -> posX.toFloat() + width.minus(textW).div(2) + (paddingLeft - paddingRight).div(2)
|
||||
Alignment.LEFT -> posX.toFloat() + paddingLeft
|
||||
Alignment.RIGHT -> width - paddingRight - textW.toFloat()
|
||||
},
|
||||
posY.toFloat() + (hitboxSize - UIItemTextButton.height) / 2f
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user