本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · リアルな地球の計算部分

Gate型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A rate gate for the draw: what createGate returns.

インポート

import type { Gate } from "@johnmorrisdotca/chikyu-earth/realistic";

定義

interface Gate {
    request(): void;
    soon(): void;
    cancel(): void;
    setMinMs(minMs: number): void;
}

メンバー

名前型説明
request(): void

Ask for fire to run: now if the last run was minMs ago or more, else once, when that time has passed.

soon(): void

Like request, but every ask made in one task is one ask, made when the task ends: a time and a view set together are one draw.

cancel(): void

Forget a run that is waiting.

setMinMs(minMs: number): void

Change the least time between runs (a lower frame rate on a battery).

例

import { createGate, type Gate } from "@johnmorrisdotca/chikyu-earth/realistic";

const gate: Gate = createGate(33, () => console.log("draw"));
gate.request();
gate.cancel();
draw

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.11.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。