Float slider
Opened this issue · 0 comments
fourlastor commented
private class FloatFieldScope constructor(name: String?, instance: Any?, field: Field) :
FieldScope(name, instance, field) {
private val value: FloatArray
init {
try {
value = FloatArray(1) { field.getFloat(instance) }
} catch (e: IllegalAccessException) {
throw RuntimeException(e)
}
}
override fun display() {
ImGui.dragFloat(name, value )
}
override fun apply() {
try {
field.setFloat(instance, value[0])
} catch (e: IllegalAccessException) {
throw RuntimeException(e)
}
}
}