Lua: re-assign muiltiple button callbacks at once for different scenes/modes?

When changing from one scene/mode/menu to another, I individually assign a bunch of things like button callbacks. What's the least messy approach?

Conceptually, if I could "turn on/off" individual imported script, that would be great. Each script could then have its own update loop, button callbacks, etc. But I don't think that's possible.

What do people prefer for this?


Take a look at Input Handlers in the docs — this should be exactly what you need.


Cool! Just like graphics contexts. And I see I can override some inputs while leaving others alone—perfect!

1 Like