本文へ移動

Tsunagi繋ぎ

同じ印の2つを別々の線で結び、盤を埋めます。収録された問題やシード付きの問題で遊べます。

「つなぎ」は、物をつなぐことを表す言葉です。 名前について(英語)

目次

リファレンス · 遊べる盤

zoomedAbout関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board.

インポート

import { zoomedAbout } from "@johnmorrisdotca/tsunagi/play";

定義

function zoomedAbout(view: TsunagiView, factor: number, px: number, py: number, box: number): TsunagiView

引数

名前型説明
viewTsunagiView

The current zoom and pixel translation.

factornumber

The positive zoom scale.

pxnumber

The horizontal pointer position in pixels.

pynumber

The vertical pointer position in pixels.

boxnumber

The available square view size or edge bounds.

戻り値

TsunagiView

A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board.

例

import { zoomedAbout } from "@johnmorrisdotca/tsunagi/play";

console.log(zoomedAbout({zoom:1,x:0,y:0},1.2,320,240,640));
{ zoom: 1.2, x: -64, y: -48 }

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/tsunagi 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。