1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Z-Layer

Discussion in 'Scripting Workshop' started by jhox, Apr 27, 2018.

  1. jhox

    jhox New Member

    Messages:
    11
    I have created a big knob for cutoff filter & a tiny knob for resonance.
    I want to place the tiny knob in the center of the big knob.

    Code:
    on init
      make_perfview
      set_script_title("Z-Layer")
      set_ui_height_px(368)
      message("")
      declare $ID
      declare ui_slider $cutoff_filter(0, 1000000)
      $ID := get_ui_id($cutoff_filter)
      set_control_par_str($ID,$CONTROL_PAR_PICTURE,"big_knob")
      set_control_par($ID,$CONTROL_PAR_DEFAULT_VALUE,500000)
      set_control_par($ID,$CONTROL_PAR_Z_LAYER,0)
      declare $cf_x := 250
      declare $cf_y := 108
      move_control_px($cutoff_filter,$cf_x,$cf_y)
      declare ui_slider $resonance_filter(0, 1000000)
      $ID := get_ui_id($resonance_filter)
      set_control_par_str($ID,$CONTROL_PAR_PICTURE,"tiny_knob")
      set_control_par($ID,$CONTROL_PAR_DEFAULT_VALUE,500000)
      set_control_par($ID,$CONTROL_PAR_Z_LAYER,1)
      declare $cfdiff_x := 60
      declare $cfdiff_y := 60
      move_control_px($resonance_filter,$cf_x+$cfdiff_x,$cf_y+$cfdiff_y)
      set_control_help($cutoff_filter,"Cutoff...")
      set_control_help($resonance_filter,"Resonance...")
    end on
    I can move both knobs independly as expected (it works even without setting the Z-Layer - default 0).

    But when I move the mouse cursor to the resonance knob (layer 1), the help text of the cutoff knob (layer 0) will shown instead of the help text of the resonance knob.

    I have assumed the Z-Layer feature will help out in this kind of layout.

    Is this a bug or am I using the $CONTROL_PAR_Z_LAYER in a wrong way?
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    It might be a bug. But in any case when you have overlapping controls like this, it might make more sense writing a more generalized help text that covers both controls that are stacked, anyways.