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

Add offset for TextureProgress progress texture #823

Closed
KoBeWi opened this issue May 11, 2020 · 1 comment · Fixed by godotengine/godot#38722
Closed

Add offset for TextureProgress progress texture #823

KoBeWi opened this issue May 11, 2020 · 1 comment · Fixed by godotengine/godot#38722
Milestone

Comments

@KoBeWi
Copy link
Member

KoBeWi commented May 11, 2020

Describe the project you are working on:
2D mobile game.

Describe the problem or limitation you are having in your project:
So, I have 3 textures like this:
previu
I'm using them for TextureProgress node. First and third texture have a size of 544x198, the middle one is 362x70. Here's what it looks like when I put it in the node:
badstuff
As you can see, the progress texture is aligned in the corner and there's no way to center it. I can't make it the same size as other textures, because the transparent pixels are counted in progress to, so it would make the bar inaccurate.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
There should be a way to offset the progress texture. Other textures can easily be aligned in image editing software, but the progress can't, because it needs to contain solely the part that will show the progress. I've ran into this problem multiple times and it makes it impossible to make fancy TextureProgress nodes. Offset for progress texture would fix this.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
In the Texture section of TextureProgress, there could be an additional Vector2 property called progress_offset, which would move the progress texture from the corner.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
This can be worked around by using other nodes as over and under textures, but it kills the purpose of TextureProgress. IMO this is a common need for this node.

Is there a reason why this should be core and not an add-on in the asset library?:
It's about core node.

@FrankAlbella
Copy link

Very much agree and was looking into writing a proposal about this. Can imagine this is a common issue. Using the several nodes workaround also makes using the Nine Patch Stretch feature tedious, as all 3 nodes must be aligned and resized.

@KoBeWi KoBeWi added this to the 4.0 milestone Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants