Please how do you check if the input focus is on a game object’s collision object?
Input focus is acquired for the game object, not individual components. As far as I know there’s no way to check if a game object has input focus. Usually you just acquire it on init
and release it on final
.
I suppose you could check by just having a simple print message in the on_input function? Just on_input print("hey, it’s me: ", msg.url())…
I think that OP is asking about how to detect if the input is on the collision object of a game object.
Input is registered globally and then broadcasted to all the listeners with acquire input focus. It’s the responsibility of the Dev to check coordinates and see if it would hit something.
Another way is to have click collision object that gets moved around and use on message to detect collision between game object collision and click.