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

fitViewfunction

The view that shows the whole area, centred, its tiles as big as fit between the least and the most. A picture nobody presses (a finished grid, the set-up preview) passes a smaller least, so a whole grid fits its box.

Import it

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

Definition

function fitView(area: Area, width: number, height: number, least?: number): View

Parameters

NameTypeDescription
areaArea

The occupied table bounds.

widthnumber

The available viewport width in pixels.

heightnumber

The available viewport height in pixels.

least (optional)number

The minimum permitted tile size.

Returns

View

The view that shows the whole area, centred, its tiles as big as fit between the least and the most. A picture nobody presses (a finished grid, the set-up preview) passes a smaller least, so a whole grid fits its box.

Examples

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

const area = {top:0,left:0,rows:1,cols:3};
console.log(fitView(area,640,480));
{ tile: 56, x: 236, y: 212 }

What it prints (run when this page was built)

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