Skip to the content

Kumimoji組み文字

Build crosswords from seeded English or Japanese tile bags, alone or at a shared table.

Kumimoji means assembled characters in Japanese. About the name

Contents

Reference · Rules, tiles and records

edgePanfunction

Which way, and how far, the table pans this frame for a tile dragged to (px, py): toward the edge it is near.

Import it

import { edgePan } from "@johnmorrisdotca/kumimoji";

Definition

function edgePan(px: number, py: number, width: number, height: number): { dx: number; dy: number; }

Parameters

NameTypeDescription
pxnumber

The horizontal pointer position in pixels.

pynumber

The vertical pointer position in pixels.

widthnumber

The available viewport width in pixels.

heightnumber

The available viewport height in pixels.

Returns

{ dx: number; dy: number; }

Which way, and how far, the table pans this frame for a tile dragged to (px, py): toward the edge it is near.

Examples

import { edgePan } from "@johnmorrisdotca/kumimoji";

console.log(edgePan(5,240,640,480));
{ dx: 6.888888888888889, dy: 0 }

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kumimoji 1.6.0.