GameObjRaw:
Base interface of all game objects.add<T>(comps?: CompList | GameObj): GameObj<T>
Add a child.since
readd<T>(obj: GameObj): GameObj<T>
Remove and re-add the game obj, without triggering add / destroy events.remove(obj: GameObj): void
Remove a child.since
removeAll(tag: Tag): void
Remove all children with a certain tag.since
removeAll(): void
Remove all children.since
get(tag: Tag | Tag[], opts?: GetOpt): GameObj[]
Get a list of all game objs with certain tag.since
query(opt: QueryOpt): GameObj[]
Get a list of all game objs with certain properties.since
children: GameObj[]
Get all children game objects.since
tags: string[]
Get the tags of a game object.since
fixedUpdate(): void
Update this game object and all children game objects.since
update(): void
Update this game object and all children game objects.since
draw(): void
Draw this game object and all children game objects.since
drawInspect(): void
Draw debug info in inspect modesince
clearEvents(): void
is(tag: Tag | Tag[]): boolean
If there's certain tag(s) on the game obj.use(comp: Comp | Tag): void
Add a component or tag.unuse(comp: Tag): void
Remove a tag or a component with its id.on(event: string, action: (args: any)=>void): KEventController
Register an event.trigger(event: string, args: any): void
Trigger an event.destroy(): void
Remove the game obj from scene.c(id: Tag): Comp | null
Get state for a specific comp.inspect(): GameObjInspect
Gather debug info of all comps.onAdd(action: ()=>void): KEventController
Register an event that runs when the game obj is added to the scene.onUpdate(action: ()=>void): KEventController
Register an event that runs every frame as long as the game obj exists.since
onDraw(action: ()=>void): KEventController
Register an event that runs every frame as long as the game obj exists (this is the same as `onUpdate()`, but all draw events are run after all update events).since
onDestroy(action: ()=>void): KEventController
Register an event that runs when the game obj is destroyed.since
exists(): boolean
If game obj is attached to the scene graph.isAncestorOf(obj: GameObj): boolean
Check if is an ancestor (recursive parent) of another game objectsince
transform: Mat4
Calculated transform matrix of a game object.since
paused: boolean
If update the game obj (run "update" event or not).id: GameObjID | null
A unique number ID for each game object.canvas: FrameBuffer | null
The canvas to draw this game object onsince