Short Summary
I have been running through my tests and found that I really need to test, through GUT and continuous testing, if the objects that I am creating are able to be overlapped properly. Especially for more complicated drag and drop functionality – Combining Objects and their shapes, etc.
While I can test some of the functionality manually I would like to keep testing through code as much as possible.
Pseudo Code Example
As a basic example – No code:
## test_overlapping_areas
# Create First Area2D
# Create Child CollisionPolygon2D for First Area2D - Set Area
# Create Second Area2D
# Create Child CollisionPolygon2D for Second Area2D - Set Area
# Assert True that area has overlapping areas
While this is a simple draft of what needs to be done, there are still some steps missing for what I need to do.
How am I able to specify the areas that are overlapped?
How am I able to define the space, points, area that they contain?
In summary, how can I create a new area2D with collision shapes to be modified through code that can show that the areas have been overlapped.
What I have done:
I had a look at the PhysicsServer as it looks like I needed to run the _process
function to get the overlapping areas to be calculated. I don’t need or have a specific _process
function.
Is there a way to do this without needing to create an empty _process
function?
Each time that I try to incorporate a test the has_overlapping_areas()
function, the result remains empty. Still assuming that the _process
hasn’t been run. Even when I try to run the _process
it doesn’t allow anything else to be calculated – I’m suspecting because I don’t have a _process
function created.
I am still unable to trigger the area_entered
or area_exited
signals. Meaning that I can only manually use the triggered functions within the callable. Which means that I am unable to successfully tell if any previous actions have been able to trigger the signals that are needed.