XYZ_PARAM_SCRATCH_PAD
Active element that displays nothing but lets you control three parameters at the same time: one for the horizontal movements (x), one for the vertical movements (y), and one for a virtual 3rd dimension, controlled by the mouse wheel and '+' and '-' keys. The values of the parameters are incremented/decremented depending on the 'scratches' (push button/drag/release button) done with the mouse.
Attributes brief detailed show all inherited
For attributes add a 'x_', 'y_' or 'z_' prefix for each dimension. Note that only one dimension is mandatory (you do not need to connect all parameters: you can use for example the x and y controls only).
See XYZ_PARAM_CLICK_PAD for a similar element supporting mouse clicks.
Examples
Parameters change only on mouse drag or mouse wheel. Note that N_pixel_range is exposed and can be adjusted on the tly.
- <!-- demo params -->
- <PARAM id="x" min="0" max="500" default="0" />
- <PARAM id="y" min="0" max="200" default="0" />
- <PARAM id="z" min="-10" max="10" default="0" />
- <!-- widget to make a background and overlay layers -->
- <WIDGET background_color="#d9f0ff" layout_type="layer_stack">
- <!-- the pad -->
- <XYZ_PARAM_SCRATCH_PAD id="xyz_pad" width="500" height="200" x_param_id="x" y_param_id="y" y_reverse="true" x_fine_ratio="10" x_pixel_range="500" y_pixel_range="200" y_fine_ratio="10" z_param_id="z" />
- <!-- info line -->
- <COLUMN spacing="10">
- <ROW spacing="5">
- <TEXT value="mouse position (x/y):" />
- <PARAM_TEXT param_id="xyz_pad.mouse_position.x" />
- <PARAM_TEXT param_id="xyz_pad.mouse_position.y" />
- </ROW>
- <ROW spacing="10">
- <PARAM_TEXT_CONTROL param_id="x" content="x: {value}" />
- <PARAM_TEXT_CONTROL param_id="y" content="y: {value}" />
- <PARAM_TEXT_CONTROL param_id="z" content="z: {value}" />
- <PARAM_TEXT param_id="xyz_pad.mouse_down" value_format=".0" content="mouse_down: {value}" />
- <PARAM_TEXT param_id="xyz_pad.mouse_over" value_format=".0" content="mouse_over: {value}" />
- <PARAM_TEXT param_id="xyz_pad.focus" value_format=".0" content="focus: {value}" />
- </ROW>
- <ROW spacing="5">
- <TEXT value="pixel_range (x/y/z):" />
- <PARAM_TEXT_CONTROL param_id="xyz_pad.x_pixel_range" />
- <PARAM_TEXT_CONTROL param_id="xyz_pad.y_pixel_range" />
- <PARAM_TEXT_CONTROL param_id="xyz_pad.z_pixel_range" />
- </ROW>
- </COLUMN>
- <!-- text when mouse is pressed -->
- <TEXT id="mouse_down_text" value=" MOUSE PRESSED " v_offset="-63" font_size="+5" font_weight="bold" background_color="#7681b3" text_color="#FFFFFF" />
- <PARAM_LINK from="xyz_pad.mouse_down" to="mouse_down_text.visible" />
- <!-- detect mouse wheel events -->
- <ACTION_TRIGGER event_id="xyz_pad.mouse_wheel_up" script="
- events_info = "MOUSE WHEEL UP";
- text_events.opacity = 1;
- animate_opacity = 0;
- " requires="events_info;text_events.opacity;animate_opacity"/>
- <ACTION_TRIGGER event_id="xyz_pad.mouse_wheel_down" script="
- events_info = "MOUSE WHEEL DOWN";
- text_events.opacity = 1;
- animate_opacity = 0;
- " />
- <STRING id="events_info" default="" />
- <TEXT id="text_events" string_id="events_info" v_offset="63" font_size="+5" font_weight="bold" background_color="#7681b3" text_color="#FFFFFF" opacity="0" />
- <!-- param_animator to fade_out text -->
- <PARAM_ANIMATOR duration_ms="500" id="animate_opacity" param_id="text_events.opacity" exposed="true" />
- </WIDGET>