scaleFactor関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The factor a size in per cent asks for: 1 for any craft that does not take the slider, and the size between 60 and 100 per cent, in steps of 5, for a concept.
インポート
import { scaleFactor } from "@johnmorrisdotca/uchusen-rockets";
定義
function scaleFactor(rocket: string, variant: string, percent: unknown): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
rocket | string | A rocket's id. |
variant | string | A variant's id. |
percent | unknown | The size asked for, in per cent, or the text of one. |
戻り値
number
A number from 0.6 to 1; 1 for a craft that does not scale.
例
import { scaleFactor } from "@johnmorrisdotca/uchusen-rockets";
console.log(scaleFactor("fleet-emiake", "fleet-emiake", "80"), scaleFactor("saturn-v", "saturn-v", 80));0.8 1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。