Skip to content
glyphcss

Hit Layer Interactivity

Loading…

Hover the anchor to highlight it; click or press Enter/Space to toggle selection. Drag elsewhere to orbit. Open Code for the same button with GlyphHotspot in React/Vue or scene.addHotspot in JavaScript.

  • at is a world-space [x, y, z]; string vertex IDs are unsupported.
  • size: [width, height] uses character cells; default [1, 1].
  • Hotspots are centered on their projected cell and hidden outside the view, without surface-depth occlusion.
  • Put a real button inside the hotspot for focus, keyboard activation, and an accessible label. Its DOM can carry your hover/focus styles.
const anchor = scene.addHotspot({ id: "door", at: [50, 50, 50], size: [4, 2] });
anchor.setAt([1, 0, 0]);
anchor.remove();

setAt preserves the element and its listeners. Only registered hotspots add DOM nodes; the mesh remains one text grid. scene.destroy() removes the hit layer.