Skip to content

waxml xy handle

Hans Lindetorp edited this page Apr 5, 2023 · 2 revisions

The CustomElement is a 2D-slider that can be dragged on the x and/or y axis. It has to be a child of a waxml-xy-area and should be used to control variables in WAXML. The variable names to be set in WAXML are specified using the ''targets'' attribute. All sources (x, y, angle, radius & dragged) range between 0 and 1. "Angle" defaults to 0 at the position 90 deg to the right, "radius" is the distance to the center, and "dragged" is either 0 or 1 depending on if it's dragged or not)

Ex.1 A single element in a circular :

<waxml-xy-handle
  x="0.5"
  y="0.5"
  width="25px"
  height="25px"
  catch="false"
  direction="xy"
  angleOffset="0"
  sources="x, y, angle, radius, dragged"
  targets="x1, y1, angle1, radius1, dragged1"
></waxml-xy-handle>

Attributes:

x: initial x-position (0-1) y: initial y-position (0-1) width: width of handle height: height of handle catch: "true" or "false" - indicates if the handle should jump to the pointer if clicked anywhere in the parent element. direction: "x", "y" or "xy" - determains in which direction(s) the handle may be dragged angelOffset: (0-1) offsets the zero angle value from the default 90 deg to the right as the zero value. sources: comma-separated string with one or several of the following parameters: "x, y, angle, radius, dragged" targets: comma-separated string with any WAXML variable names that should be set by the corresponding source for this handle.

Example: Simple vertical slider controlling WAXML variable $y1

<waxml-xy-handle
  y="0"
  direction="y"
  sources="y"
  targets="y1"
></waxml-xy-handle>
Clone this wiki locally