onClick(tag: Tag , action: (a: GameObj )=>void ): KEventController

Register an event that runs when game objs with certain tags are clicked (required to have the area() component).

paramtag- The tag to listen for.

paramaction- The function to run when the event is triggered.

// click on any "chest" to open
onClick("chest", (chest) => chest.open())

returnsThe event controller.

sincev2000.1

groupInput

subgroupMouse