FlightClockクラス
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The clock of one timeline: where it is and whether it runs. It only moves when told to, once a frame by whoever draws, so a timeline out of sight stands still.
インポート
import { FlightClock } from "@johnmorrisdotca/uchusen-rockets";
定義
class FlightClock
new FlightClock(flight: Flight): FlightClock
引数
| 名前 | 型 | 説明 |
|---|---|---|
flight | Flight | The flight whose clock this is. |
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
flight | Flight | |
position | number | |
playing | boolean | |
ended | boolean | |
play | (): void | |
pause | (): void | |
seek | (position: number): void | |
advance | (seconds: number): void | Moves on by |
例
import { FlightClock, flightOf } from "@johnmorrisdotca/uchusen-rockets";
const flight = flightOf("falcon-9", "block-5");
if (flight) {
const clock = new FlightClock(flight);
clock.play();
clock.advance(2.4);
console.log(clock.position, clock.ended);
}1 false出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。