keptView関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A view kept inside the board: never a gap between the board's edge and the box's. box is the box's width in pixels.
インポート
import { keptView } from "@johnmorrisdotca/tsunagi/play";
定義
function keptView(view: TsunagiView, box: number): TsunagiView
引数
| 名前 | 型 | 説明 |
|---|---|---|
view | TsunagiView | The current zoom and pixel translation. |
box | number | The available square view size or edge bounds. |
戻り値
TsunagiView
A view kept inside the board: never a gap between the board's edge and the box's. box is the box's width in pixels.
例
import { keptView } from "@johnmorrisdotca/tsunagi/play";
console.log(keptView({zoom:1,x:0,y:0},640));{ zoom: 1, x: 0, y: 0 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。