onHide(action: ()=>void ): KEventController
paramaction- The function that is run what the tab is hidden.
deprecateduse `onTabHide` instead
Register an event that runs when tab is hidden.
// spooky ghost
let ghosty = add([
pos(center()),
sprite("ghosty"),
anchor("center"),
]);
// when switching tabs, this runs
onHide(() => {
destroy(ghosty);
add([
text("There was never aa ghosttttt"),
pos(center()),
anchor("center"),
]);
});
returnsThe event controller.
sincev3001.0
groupEvents