Optional
target: TProtected
Optional
_generatorProtected
_isProtected
_loopProtected
_taskRest
...args: anyRunner対象オブジェクト
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
[jp] 内部Generatorをクリア(コルーチン処理消去)
[en] Clear current running generator.
this
[jp] 処理をポーズする(step処理をスキップするようにする)
[en] Pause coroutine stepping.
this
[jp] taskリストからジェネレーターをリセット
[en] Reset
this
[jp] ポーズ中の処理を再開
[en] Resume coroutine stepping.
this
進行方向(vector)を回転
進行方向(vector方向)をセット(度数単位)
度数単位
Optional
speed: number[jp] ループを設定
[en] Whether to reset generator after it is "done".
this
速度をセット(内部的にはvector長をセット)
vectorパラメータをセット
内部ラジアン値及びスピード値も同時に変更される
Optional
x: number無指定の場合はそのまま
Optional
y: number無指定の場合はそのまま
[jp] step可能にする 内部ジェネレーターリセットも兼ねる
[en] Reset and enable coroutine stepping
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
targetプロパティが確定したRunner