# Knob - how to change the font?



## Lukas K (Oct 4, 2012)

Hey guys!

Is it possible to change the font for the knob text/value? I tried it just like with the labels but with no success.

If not, is it possible to use a label instead, so it would display the volume of a group (for example) and when I would turn the knob to control the volume (with hidden value), it would show the changes continuosly just like the knob value does?

I somehow struggle with this.

Thanks!

Lukas


----------



## mk282 (Oct 4, 2012)

You cannot. You will have to fake it with ui_slider and ui_label.


----------



## Lukas K (Oct 4, 2012)

I'm trying that, but the value generated by the ui_label is not changing when I'm moving the ui_slider.

Could you please check the script?

on init
declare ui_label $label (1,1)
set_text ($label,get_engine_par_disp($ENGINE_PAR_VOLUME, 0, 0, -1) & " dB")
set_control_par(get_ui_id($label), $CONTROL_PAR_FONT_TYPE, 14)
hide_part ($label,$HIDE_PART_BG)
move_control_px ($label,222,46)

declare ui_slider $slider (0,1000000)
set_control_par_str(get_ui_id($slider),$CONTROL_PAR_TEXT,"")
set_control_par_str(get_ui_id($slider),$CONTROL_PAR_PICTURE,"XY")
set_control_par(get_ui_id($slider), $CONTROL_PAR_MOUSE_BEHAVIOUR, -500)
$slider := get_engine_par($ENGINE_PAR_VOLUME,0, 0, -1)
end on

on ui_control ($slider )
set_engine_par($ENGINE_PAR_VOLUME, $slider , 0, 0, -1)
end on

Thanks!


----------



## polypx (Oct 4, 2012)

One small change really:


```
on init
set_ui_height_px(100)
declare ui_label $label (1,1)
set_text ($label,get_engine_par_disp($ENGINE_PAR_VOLUME, 0, 0, -1) & " dB")
set_control_par(get_ui_id($label), $CONTROL_PAR_FONT_TYPE, 14)
hide_part ($label,$HIDE_PART_BG)
move_control_px ($label,222,46)

declare ui_slider $slider (0,1000000)
set_control_par_str(get_ui_id($slider),$CONTROL_PAR_PICTURE,"XY")
set_control_par(get_ui_id($slider), $CONTROL_PAR_MOUSE_BEHAVIOUR, -500)
$slider := get_engine_par($ENGINE_PAR_VOLUME,0, 0, -1)
end on

on ui_control ($slider )
set_engine_par($ENGINE_PAR_VOLUME, $slider , 0, 0, -1)
set_text ($label,get_engine_par_disp($ENGINE_PAR_VOLUME, 0, 0, -1) & " dB")
end on
```

PS. You don't need to set_text " " of the slider, since sliders don't have text.

cheers
Dan


----------



## Lukas K (Oct 8, 2012)

Thanks a lot Dan!

Now it works nicely!

Lukas


----------

