Operating system or device, Godot version, GPU Model and driver (if graphics related):
3.0 latest compiled on October 25th
Issue description:
For example: OS.get_window_size() and Control.rect_size both let you get the width and height by doing:
.x, and .y
however, it should be .width, and .height instead, right?
however, it seems like they are returning the Vector2, so I mean it makes sense to do .x and .y, however, is it possible for those aliases to be added maybe? It could throw some people off. Especially when writing in gdscript and the intellisense thing doesn't show "width", but "x".. the dev will be like wtf O_o
edit: actually, I remember in 2.xx we used to be able to do .width on some things
The aliases existed in 2.1: http://docs.godotengine.org/en/stable/classes/class_vector2.html
But were removed in 3.0: http://docs.godotengine.org/en/latest/classes/class_vector2.html
Not sure why or if we want them back, it's up for discussion.
@akien-mga I cannot find a specific commit that removes them. Could you please link me to it?
In the C++ source, math_2d.h still has the definitions. https://github.com/godotengine/godot/blob/9e0fbb49c12a4bb12c275194b0599fdfa0b1aabf/core/math/math_2d.h#L78
Took me a while to find it as Variant bindings are not trivial, but grep helped :D
https://github.com/godotengine/godot/blob/c5da28f24cbab915098165b13f50bcda049e273e/core/variant_op.cpp#L2794-L2799
Vector2.width and Vector2.height were removed by @reduz in 2a3e00c8c7e6f997b12864755a3df3b9bd3cca05
Thanks, Akien!
It caught me off guard when I tried master branch earlier, coming from 2.x. IMO having width and height would improve readability of the script. One would know instantly that this "Vector2" refers to size of something and not position. The only con I can think of is that new users might confuse it with Rect2 width and height.
Well Rect2 doesn't expose width and height either, it exposes Vector2 size, so if we readd width and height you could do Rect2.size.width and Rect2.size.height (right now you can only use Rect2.size.x and Rect2.size.y).
I mean some might think that Vector2 is Rect2 because it has both x,y and width,height.
I think keeping x and y the only options is a better idea for consistency's sake. It's also more universal, and doesn't imply a width or height (which may be a bad idea in some cases).
It's also that a vector has magnitude, so .x and .y are actually lengths on X axis and Y axis. Makes sense?
Bug triage note: The original issue reporter closed all their issues before deleting their account. If you are affected by a similar issue/want a similar feature, please file a new ticket (referencing this one if it contains useful information) so that it can be further looked at and eventually resolved.
Most helpful comment
I think keeping
xandythe only options is a better idea for consistency's sake. It's also more universal, and doesn't imply a width or height (which may be a bad idea in some cases).