Open hydroper opened 1 year ago
This already exists in the form of linked properties (see Node2D and Node3D's scale properties), but these need to be enabled on a per-property basis.
@Calinou I'm not sure I'm understanding you right, but in the start of the issue I already mentioned the scale
properties. Yes, there is a lock button to the right of the scale
property in the editor.
@Calinou I'm not sure I'm understanding you right, but in the start of the issue I already mentioned the
scale
properties. Yes, there is a lock button to the right of thescale
property in the editor.
What I mean is that properties need to be manually opted into displaying this "linked" button, as it doesn't make sense to display that icon for all Vector2/Vector3 properties. Feel free to open a pull request for this :slightly_smiling_face:
See how it's done for Node3D's scale
property: https://github.com/godotengine/godot/blob/0f76ff2115ae56e6638e1e2bdb8851d470e6e0e3/scene/3d/node_3d.cpp#L1194
I've learned that you can use times in the input boxes! So you can do e.g.
width = 145*3
height = 56*3
And the Godot editor will automatically resolve this multiplication.
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
When you want to resize a node, generally you can change its scale values to something like
(3, 3)
(i.e. 3 times "larger").However, the anchor presets in the editor currently ignore the node's
scale
property, so you get inconsistency when using the anchor presets. Thus, you need to alternatively resize the node, however that requires you to use the brain to multiply the size(x, y)
, or you use an external calculator, which unnecessarily takes time.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add an option to prevent distortion while resizing a node in the editor, i.e. locking the ratio to
n:n
; similiar to using scale, but useful sincescale
is currently not taken into consideration within anchor presets.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A checkbox above the "Size" fields will appear in the editor, allowing to preventing distorting e.g. a bitmap (
TextureRect
).If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
It is an editor functionality.