-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
NinePatch changes texture scale when resized #33225
Comments
CC @puthre maybe related to your PR? |
@shmellyorc you'll have to have your ninepatch texture resolution smaller than what you will have on screen otherwise it will get scaled down. Previously (before #32170) it would just be distorted (but you wouldn't have seen that in your example as the margins in your example are the same everywhere). |
So that's not a regression but a bugfix? |
@puthre both scaling down and distortion is considered a bug when it comes to how 9 slices should work. if the 9 slice is smaller then the texture it should start clipping starting with the center, then the edges, then the corners until it is completely invisible with a size of 0,0 |
@Shadowblitz16 I don't think I understand your proposal (or as I understand it it would not look very good except with some hand picked use cases). The main reason for my fix as far as I remember was that you could not use the 9 patch frame at all in Stretch Mode = 2D mode where your viewport size is can be much lower than the actual resolution of the device (which happens when you deploy on a mobile device) and you need to have textures much larger than the size of the viewport to match that screen resolution. Before my fix it didn't even distorted in the same way with GLES2 and GLES3. |
No this is horrible for pixel art we shouldn't have to modify our textures because someone decided to change how 9 patches have always worked. if anything it should be a flag or a project setting to scale down these things. this is kinda why I get angry is because some person comes along and instead of just fixing the problem they do something that doesn't make sense or breaks backwards compatibility 9 slices are there to prevent the edges from being warped there is no point in them if they don't do this. if you need to scale these things, implement a way to scale the canvas or the scale the 9slice. |
@Shadowblitz16 While I can understand your frustration, I'll have to ask you to remain civil and avoid using making things personal. You may disagree with the change, but you shouldn't express anger, especially not against other community members. https://godotengine.org/code-of-conduct |
Can anyone provide a reproduction project so that we can see what works and what doesn't? |
@akien-mga Here is one |
Also having this issue with a broken downscaling after upgrading to Godot 3.2.1 It's nice there is a workaround for now, but I agree this is a bug/regression because NinePatches should never scale their corners (at least without some kind of flag allowing it set by the dev). |
@naturally-intelligent What exactly is the work around here? I've been stuck on how to fix this for hours... |
@Lucrecious Scale your texture down to be smaller than the resolution of the patch on screen. |
Not scale - I think you mean to edit your 9P textures to have less stretch than the biggest use. |
@puthre @naturally-intelligent I don't know what "less stretch than the biggest use" means or "scale your texture to be smaller than the resolution of the patch". Would it be possible for either one of you to provide a concrete example using actual numbers? An example that starts from a 9P that down scales and ends with it being fixed? Doesn't have to be a Godot file, just some text. |
@Lucrecious The nine patch margins will only stretch down if it can't fit in the small space you allocate to it on screen (small relative to the patch texture resolution). Just try to scale down the image texture that you are using for the nine patch (using gimp or something similar) and you will see what I mean. |
in 3.0, the textures wouldnt stretch (wouldnt change scale). The corners and the ninepatch would stop to the size of the corners. Ever past 3.0, I have to make very small textures. |
If you look at this tutorial image: https://tekeye.uk/android/examples/ui/android-9-patch-image-files You will have to make middle sections 2,4,5,6, and 8 very small (ex: 1x1 pixel), while your corners (1,3,7,9) can be any size. I spent the better part of a day in frustration thinking this was my fault, until I found this thread, so I feel your pain... |
Confirmed that GLES2 implementation for tiling axis stretching doesn't work. |
Fixed by #42119. |
Hello, this issue is still alive and kicking. It's not fixed by the mentioned commit. |
There are two nine patch modes, which one are you using? It would likely be better to open a new issue with full details on the issue as you experience it in recent build. |
I tried it with different modes, settings Nodes and the problem was always the same - I will open a new issue! |
See godotengine/godot#33225 for details (Basically: backwards compatibility got broken and ninepatchrect scales the corners down instead of just the middle/edges)
Godot version:
Godot 3.2 Alpha 3 (from your website)
OS/device including version:
Windows 10
Issue description:
When doing pixelated texture, resizing the Ninepatch changes its scale.
Steps to reproduce:
Minimal reproduction project:
https://i.imgur.com/VeQeuhQ.gifv
Notes: Godot 3.2 alpha 1 doesn't have this issue. Anything past alpha 1 has this issue.
The text was updated successfully, but these errors were encountered: