Skip to content
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

Nine Patch Stretch Property in TextureProgress with different Fill Modes #33222

Closed
Foxomat opened this issue Oct 31, 2019 · 10 comments
Closed

Nine Patch Stretch Property in TextureProgress with different Fill Modes #33222

Foxomat opened this issue Oct 31, 2019 · 10 comments

Comments

@Foxomat
Copy link

Foxomat commented Oct 31, 2019

Godot version:
v3.1.1.stable.official

OS/device including version:
Windows 10 Version 1903

Issue description:
-the Nine Patch Stretch Property of the TextureProgress Node doesn't work properly with all Fill Modes.
-selecting Left to Right, Right to Left, Top to Botom, Bottom to Top scales the Node as expected.
-selecting any other mode (Clockwise Modes and Bilinear Modes) prohibits the Node from scaling as the NinePatchRect but just leaves the Node in its original size.
-Issue persists when the size of the node is determined by parent container node.

Steps to reproduce:
-create a TextureProgress node
-add a texture
-set Nine Patch Stretch to On
-select an above mentioned Fill Mode (any Clockwise mode, any Bilinear mode)
(-fiddle with the size of the node)
(-compare to behavior when selecting a normal fill mode like left to right)

Minimal reproduction project:
-project is just 2 TextureProgress Nodes, the upper one stretching correctly, the lower one not.

Bug-Demo.zip

@fossegutten
Copy link
Contributor

fossegutten commented Jan 2, 2020

Was about to report a bug myself about the nine patch. The Nine Patch Stretch calculations should probably be updated for texture_progress, when the "value" gets updated.
It works fine in the ProgressBar, but that one is not ax flexible as the TextureProgress node

@Calinou Calinou changed the title Nine Patch Stetch Property in TextureProgress with different Fill Modes Nine Patch Stretch Property in TextureProgress with different Fill Modes Jun 14, 2020
@Haledire
Copy link

Haledire commented Jul 18, 2020

Still a problem as of 3.2.2
Was going to suggest a solution for someone's healthbar and noticed trying to set up a Top to Bottom bar works fine, but a bottom to top fails to stretch the fill image vertically (left and right margins seem to be working)
TexIssue

TexProgFail.zip

Additional Note: Stretch only works properly in Bottom to Top if fill is 100%
filled

@Reneator
Copy link

Still a problem in 3.2.3:

When trying to use "Nine patch rect" with a texture that is 100x100 and trying to set its rect smaller than its original size (like 50x50):

clockwise:
image
but left to right works properly:
image

@kayomn
Copy link
Contributor

kayomn commented Apr 9, 2021

Still a problem in 3.3 rc8

@Calinou
Copy link
Member

Calinou commented Apr 9, 2021

Related to #45791, which will be fixed by #45815. It's too late to merge it in 3.3, since we absolutely don't want to introduce regressions now. It can be considered for 3.4 still.

@akien-mga
Copy link
Member

Assuming fixed by #45815. Please comment if that's not the case.

@akien-mga akien-mga added this to the 4.0 milestone Jun 21, 2021
@lucassardois
Copy link

I'm not sure this is working as intended. Here is the same texture with the same stretch margins for the Left to Right fill mode and the Clockwise fill mode:

Left to Right:
image

Clockwise:
image

As you can see the Left to Right fill mode works as intended, but the clockwise fill is wrong. I'm on Godot 3.4.2.

@Calinou
Copy link
Member

Calinou commented Jan 5, 2022

@lucassardois Are you using GLES3 or GLES2 in your project? Nine-patch is only fully supported in GLES3 as it's impossible to replicate in GLES2 without causing performance drops on some devices (due to UV manipulation triggering a software fallback on many drivers).

@lucassardois
Copy link

I'm using GLES3.

@Calinou
Copy link
Member

Calinou commented Jan 5, 2022

@lucassardois Please open a new issue with a minimal reproduction project attached, as the root cause is likely different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants