0 votes

If I have a control node and it has a Node2d parent node with a scale of 0.5 and I then call the getglobalrect method of the control node in the code. I always get the rectangle of the control node that is not scaled with 0.5.
How can I get that?

asked Apr 10 in Engine by MaxEl777 (41 points)

1 Answer

+1 vote

try get_global_transform().get_scale() (this might be a bug and will be fixed in the future)

answered Apr 10 by Thakee Nathees (238 points)
edited Apr 10 by Thakee Nathees

Thanks a lot, this is a workaround when used together with the grow method of the Rect2 structure. It's probably really a bug.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.