First, no, you can't put the _process()
function inside another function.
Assuming this question is related to the "timer chaining" question we worked on earlier, here's one idea.
Why not simply connect the mouse_entered
and mouse_exited
signals of your Area2D
. In those signal handlers, just set a simple boolean flag indicating whether the mouse is currently inside the Area2D
. For example, mouse_over_button = true
in the mouse_entered
and ... = false
in the mouse_exited
.
Then, use that flag to skip the code you have in _process
if the value is false
?
As I mentioned in the other thread, there are lots of ways to do the same thing. While this might not be the cleanest overall (based on a better understanding of what you're doing), it's probably one of the easier ways to get from what you have to what you want...