layoutPortrait関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where every body is and how big, and the camera that holds them. A manual scene gives what it stores. An automatic one works it out (a row, an arc or a grid, a planet's moons round it in orbit order) and fits the camera, so its units are the camera's half-height.
インポート
import { layoutPortrait } from "@johnmorrisdotca/wakusei-planets";
定義
function layoutPortrait(scene: Portrait): Resolved
引数
| 名前 | 型 | 説明 |
|---|---|---|
scene | Portrait | The scene. |
戻り値
Resolved
Every body placed, back to front, and the camera.
例
import { addBody, defaultPortrait, layoutPortrait } from "@johnmorrisdotca/wakusei-planets";
const { placed } = layoutPortrait(addBody(addBody(defaultPortrait(), "earth"), "moon"));
console.log(placed.map((item) => `${item.body} ${item.x.toFixed(2)}`).join(", "));earth -0.65, moon 0.92出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。