debugging thing update

This commit is contained in:
minjaesong
2025-02-01 19:31:07 +09:00
parent 150b4e6b6b
commit a2006b0354
3 changed files with 63 additions and 14 deletions

View File

@@ -30,17 +30,27 @@ class UIItemHorzSlider(
val min: Double,
val max: Double,
override val width: Int,
val handleWidth: Int = 12,
initialHandleWidth: Int = 12,
private val backgroundTexture: TextureRegion? = null,
private val disposeTexture: Boolean = false
) : UIItem(parentUI, initialX, initialY) {
override var suppressHaptic = false
var handleWidth: Int = initialHandleWidth
set(value) {
// reset the scroll status
handlePos = 0.0
this.value = 0.0
field = value
handleTravelDist = width - value
}
override val height = 24
private var mouseOnHandle = false
private val handleTravelDist = width - handleWidth
private var handleTravelDist = width - handleWidth
private var handlePos = (initialValue / max).times(handleTravelDist).coerceIn(0.0, handleTravelDist.toDouble())
var value: Double = initialValue; private set

View File

@@ -23,13 +23,23 @@ class UIItemVertSlider(
val min: Double,
val max: Double,
override val height: Int,
val handleHeight: Int = 12,
initialHandleHeight: Int = 12,
private val backgroundTexture: TextureRegion? = null,
private val disposeTexture: Boolean = false
) : UIItem(parentUI, initialX, initialY) {
override var suppressHaptic = false
var handleHeight: Int = initialHandleHeight
set(value) {
// reset the scroll status
handlePos = 0.0
this.value = 0.0
field = value
handleTravelDist = height - value
}
companion object {
const val WIDTH = 16
}
@@ -37,7 +47,7 @@ class UIItemVertSlider(
override val width = WIDTH
private var mouseOnHandle = false
private val handleTravelDist = height - handleHeight
private var handleTravelDist = height - handleHeight
private var handlePos = if (max == 0.0) 0.0 else (initialValue / max).times(handleTravelDist).coerceIn(0.0, handleTravelDist.toDouble())
var value: Double = initialValue; private set