XY_PARAM_PAD
Active element that displays nothing but lets you control two parameters at the same time: one for the horizontal movements (x), one for the vertical movements (y). The values of the parameters depend on the position of the mouse on the pad.
Attributes brief detailed show all inherited
For attributes add a 'x_' or 'y_' prefix for each dimension (for example x_param_id, x_reverse, x_positions_count, etc). Note that only one dimension is mandatory (you do not need to connect all parameters: you can use for example the x control only).
Also see XY_ZOOM_SELECT_PAD as a similar widget but with "drag selection" capabilities.
Example
- <!-- demo params -->
- <PARAM id="x" min="0" max="500" default="0" />
- <PARAM id="y" min="0" max="200" default="0" />
- <!-- widget to make a background and overlay layers -->
- <WIDGET background_color="#d9f0ff" layout_type="layer_stack">
- <!-- xy_param_pad -->
- <XY_PARAM_PAD id="xy_pad" width="500" height="200" x_param_id="x" y_param_id="y" y_reverse="true" x_positions_count="10" x_fine_ratio="10" />
- <!-- info line -->
- <COLUMN spacing="5">
- <ROW spacing="5">
- <TEXT value="mouse position (x/y):" />
- <PARAM_TEXT param_id="xy_pad.mouse_position.x" />
- <PARAM_TEXT param_id="xy_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 param_id="xy_pad.mouse_down" value_format=".0" content="mouse_down: {value}" />
- <PARAM_TEXT param_id="xy_pad.mouse_over" value_format=".0" content="mouse_over: {value}" />
- <PARAM_TEXT param_id="xy_pad.focus" value_format=".0" content="focus: {value}" />
- </ROW>
- </COLUMN>
- <!-- text when mouse is pressed -->
- <TEXT id="mouse_down_text" value=" MOUSE PRESSED " v_offset="-53" font_size="+5" font_weight="bold" background_color="#7681b3" text_color="#FFFFFF" />
- <PARAM_LINK from="xy_pad.mouse_down" to="mouse_down_text.visible" />
- <!-- detect mouse wheel events -->
- <ACTION_TRIGGER event_id="xy_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="xy_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="53" 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>