Godot Version
4.2.2
Question
I have a scene where a texture rect contains a Control node and that control node contains a label node. My goal is to move the label node within the bound of its parent control node (i wanted to test another issue i still haven’t solved: Logic to keep control node within the borders of its parent control node).
Anyway, in order to assess if the label stayed within the bounds I used the draw function but the rectangle is not matching the position of the control node.
I drew in red where the control node is approximately situated.
Here is the code for drawing the rectangle:
func _draw():
draw_rect(Rect2(global_position.x, global_position.y, size.x, size.y), Color.AQUA)