User Interface Commands
97
KSP Reference Manual
12.22. set_knob_defval()
set_knob_defval( ,)
Assign a default value to a knob to which the knob is reset when Cmd-clicking (Mac) or Ctrl-clicking (PC) the knob.
In order to assign a default value to a slider, use
set_control_par(,$CONTROL_PAR_DEFAULT_VALUE,)
Examples
on init
declare ui_knob $Knob(-100,100,0)
set_knob_defval ($Knob,0)
$Knob := 0
declare ui_slider $Slider (-100,100)
set_control_par(get_ui_id($Slider),$CONTROL_PAR_DEFAULT_VALUE,0)
$Slider := 0
end on
Assigning default values to a knob and slider
See Also
$CONTROL_PAR_DEFAULT_VALUE
12.23. set_knob_label()
set_knob_label(,)
Assign a text string to a knob
Examples
on init
declare !rate_names[18]
!rate_names[0] := "1/128"
!rate_names[1] := "1/64"
!rate_names[2] := "1/32"
!rate_names[3] := "1/16 T"
!rate_names[4] := "3/64"
!rate_names[5] := "1/16"
!rate_names[6] := "1/8 T"
!rate_names[7] := "3/32"
!rate_names[8] := "1/8"
!rate_names[9] := "1/4 T"
!rate_names[10] := "3/16"
!rate_names[11] := "1/4"
Do'stlaringiz bilan baham: |