This is a minimal example I made to explain how the input stack works in Defold.
InputStack.zip (13.2 KB)
The setup:
- 3 collection proxies
- A couple of scripts
- In the main collection, you can change the delay on
loader
scripts to change the order in which the collections load. - When you run the project, it prints logs with the order in which scripts acquire input.
- Use
space
to print a log with the order in which scripts receive events. - You can also uncomment
return true
ininternalN.script - on_input
to see where exactly input propagation will stop.
Register #1 is [main:/go3#loader]
Register #2 is [main:/go1#loader]
Register #3 is [main:/go2#loader]
Register #4 is [col2:/go#internal2]
Register #5 is [col1:/go#internal1]
Register #6 is [col3:/go#internal3]
Input in url: [col2:/go#internal2] reg #4
Input in url: [main:/go2#loader] reg #3
Input in url: [col1:/go#internal1] reg #5
Input in url: [main:/go1#loader] reg #2
Input in url: [col3:/go#internal3] reg #6
Input in url: [main:/go3#loader] reg #1
I hope this will be helpful.