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

turnViewfunction

A view the player zoomed or panned, turned a quarter clockwise with the table about the middle of its box: the same zoom, and the spot of the table that was in the middle stays there. (A fitted view simply fits again.)

On the screen a square's corner is x + col * tile; the turn takes a point (row v, col u) of the table to (row u, col 1 - v), which is a quarter turn about the middle of square (0, 0) — the same turn as turnPlace.

Import it

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

Definition

function turnView(view: View, width: number, height: number): View

Parameters

NameTypeDescription
viewView

The current tile size and pixel translation.

widthnumber

The available viewport width in pixels.

heightnumber

The available viewport height in pixels.

Returns

View

A view the player zoomed or panned, turned a quarter clockwise with the table about the middle of its box: the same zoom, and the spot of the table that was in the middle stays there. (A fitted view simply fits again.)

Examples

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

const view = {tile:40,x:100,y:100};
console.log(turnView(view,640,480));
{ tile: 40, x: 420, y: 20 }

What it prints (run when this page was built)

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