Check if mouse cursor is on a image widget

It will definetely work, but it is not a good practice to iterate over a for loop in an event tick function. This is very expensive as it is processed every frame. Better solution would be to group the contents you want to check in an overlay panel or similar and check only that one panel. All of its children will automatically be checked as well.