1. Reference
  2. Display

<overlay>

Inside a drawing tool written in HAM, the paths the tool draws over the pad, like a lasso's outline.

Display
overlay.ham
<draw-tool name="lasso"
           label="Lasso"
           icon="gesture"
           cursor="crosshair"
           @on.touch.start="$tool.points = $event.doc_x + ',' + $event.doc_y"
           @on.touch.move="$tool.points = $tool.points + ' ' + $event.doc_x + ',' + $event.doc_y"
           @on.touch.end="#pad.select.path:$tool.points; $tool.points = ''">
    <state points=""/>
    <overlay>
        <path in="$pad"
              points="$tool.points"
              closed="true"
              stroke="#FFFFFF"
              dash="6 4"/>
    </overlay>
</draw-tool>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.

This page is also Markdown, and all of HAM is in llms.txt.