Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

distanceTo function

Distance in px from a point to a box, 0 inside.

View as Markdown
import { distanceTo } from '@dioramajs/blocks/glow'
function distanceTo(
  p: Point,
  x: number,
  y: number,
  width: number,
  height: number,
): number

Parameters

NameTypeDescription
pPoint
xnumber
ynumber
widthnumber
heightnumber

Defined in packages/blocks/src/glow.ts.