本文へ移動

Meikyuu迷宮

シード付きの迷路と矢印パズルを作り、番号付きの問題を進め、平面や立体表面で遊べます。

「迷宮」は迷路のように入り組んだ場所を表す言葉です。 名前について(英語)

目次

リファレンス · 遊べる盤

edgeNudge関数

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

How far to move the view in a frame for a finger at (px, py) of a box: the board moves the other way, toward the finger. It is gentle: nothing at EDGE pixels from a side, rising in a line to EDGE_STEP pixels a frame at the side itself, so a finger that only brushes the edge of the box moves the view hardly at all, and one held at the very edge moves it steadily.

インポート

import { edgeNudge } from "@johnmorrisdotca/meikyuu/play";

定義

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

引数

名前型説明
pxnumber

The horizontal pointer position in viewport pixels.

pynumber

The vertical pointer position in viewport pixels.

widthnumber

The native width in cells or pixels specified by this signature.

heightnumber

The native height in cells or pixels specified by this signature.

戻り値

{ dx: number; dy: number; }

How far to move the view in a frame for a finger at (px, py) of a box: the board moves the other way, toward the finger. It is gentle: nothing at EDGE pixels from a side, rising in a line to EDGE_STEP pixels a frame at the side itself, so a finger that only brushes the edge of the box moves the view hardly at all, and one held at the very edge moves it steadily.

例

import { edgeNudge } from "@johnmorrisdotca/meikyuu/play";

console.log(edgeNudge(5,100,390,844));
{ dx: 6.204545454545454, dy: 0 }

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

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

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