-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stretching with anchors does not take into account the scale of the nodes. #56746
Comments
Related to #52383.
With Godot's support for multiple resolutions and the 2D scale factor property, you do not need to do this. Control scaling should only be used for animation purposes or prototyping, not for anything else. |
Oh, that sounds like just what I needed, thank you! But I still think this behavior from the scale looks wrong. |
Hm, what I don't understand then: I understand that scale might not be the best bet here, but when I tried 2d stretching with a lower base resolution instead things doesn't look so crisp on desktop. |
Use the new 2D scale factor property to increase the size of UI on mobile platforms, regardless of the actual screen resolution. You can do this automatically on mobile platforms by overriding the Stretch Shrink project setting with the |
Big thanks, that worked very well! I have read Multiple Resolutions multiple times but didn't found the answer there, maybe it makes sense to document it there as well and link it to the Feature Tag. |
Is there a way to change the shrink by code (besides |
Yes, see godotengine/godot-docs#7136. This can be done in 3.x too by changing shrink, which accepts floating-point values since 3.4. The Multiple Resolutions demo project showcases this for both 4.x and 3.x (Window Scale Factor in the demo). |
Thanks for the report! Consolidating in #19068. |
Godot version
3.4.2.stable.mono
System information
Windows 11, GLES3, RTX 3080 Ti
Issue description
I made a microscopic pixel interface in my game with the ability to scale (x1, x2, x3, etc.) as in minecraft. When using wide anchors stretching does not take into account the scale of the nodes, so they are out of the edge of the window.
x1

x2

Steps to reproduce
Minimal reproduction project
AnchorAndScale.zip
The text was updated successfully, but these errors were encountered: