turnView関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { turnView } from "@johnmorrisdotca/kumimoji";
定義
function turnView(view: View, width: number, height: number): View
引数
| 名前 | 型 | 説明 |
|---|---|---|
view | View | The current tile size and pixel translation. |
width | number | The available viewport width in pixels. |
height | number | The available viewport height in pixels. |
戻り値
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.)
例
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 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。