Protected
Optional
_generatorProtected
_isProtected
_loopPrivate
_speed速度値(内部的にはvector長)
Protected
_taskPrivate
_vectorvector用の内部ラジアン値 基本的にはこの値をベースにvectorパラメータを更新する
Rest
...args: anyOptional
targetRunner対象オブジェクト
Protected
vectorvectorプロパティは保護されてます。
取得する場合はgetVector
メソッドを使用のこと
[jp] 稼働中の内部ジェネレータがあるかどうかを返す
[en] Returns true when inner-generator doesn't exists
[jp] 稼働状態を返す。 falseの際はstepを実行しても進まない pause/resumeなどで更新
[en] Return isAwake
速度(vector長)
vectorの向きをラジアン値で返す
x軸進行方向(vector.x)
y軸進行方向(vector.y)
Static
action(WIP, maybe removed)
[en] Add action with pre-registered action name
[jp] 予め登録したアクション名でアクションを追加
import {ActionDictionary,BaseRunner} from "pgul"
ActionDictionary.register("goto", function* (x, duration) {
let count = 0;
const progressUnit = (x - this.target.x) / duration;
while (count < duration) {
this.target.x += progressUnit;
yield count++;
}
});
// Load action
const runner = new BaseRunner<any, "goto">();
runner.addActionByName("goto", 200, 120);
Rest
...args: anyargs for runnerAction
[jp] タスクを追加
[en] Add coroutine task
this
func<*function>とarguments<any[]>をもったオブジェクト
追加後に内部Generatorをリセットするかどうか
[jp] JSONでタスク設定
[en] addTaskFromJSON
this
Static
convert[jp] taskリストをジェネレーターオブジェクトに変換
[en] convertTaskListToGenarator
Converted Generator
task.actionのthisとして扱うオブジェクト
Static
registerRest
...params: [name: string, genFunc: ((this: BaseRunner<any, string>, ...args: any[]) => Generator<unknown, any, unknown>)]Generated using TypeDoc
Runner BaseRunnerにVector2要素および関連機能を持たせたクラス
Example
Description
vectorについて
Runnerは対象物をコントロールするための2次元Vectorを内部に保持する これにより速度や進行方向を操作することが可能
vector値の読み書き
などを使い、直接のVector書き換えはやらないこと
vector長の大きさはsetSpeed、 方向はsetDirection等 でも操作可能