-
-
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
get_image() gives wrong result on GradientTexture2D #66627
Comments
Size properties are set after godot/scene/resources/texture.cpp Lines 2518 to 2520 in 56563ef
godot/scene/resources/texture.cpp Lines 2414 to 2418 in 56563ef
So in As a workaround, you can put either snippet at the beginning of
|
The update is likely deferred so that the gradient isn't generated twice when both width and height are set at the same time. Otherwise, whenever the gradient uses a non-default width and height, it'd be generated twice. We may not be able to fix this without causing this inefficiency, so I'd vote for documenting this in the class reference instead. |
This is confirmed in 4.0.2 as well, is there already a commit for the documentation update with the work around? |
Fixed by #81137 |
Godot version
4.0 beta2 (mono version)
System information
Ubuntu 22
Issue description
the get_image() command gets an image with both wrong size and wrong general look when called on GradientTexture2D.
It seams the the image is always 64x64 pixels. It depicts a different gradient with generally the same colors.
Steps to reproduce
Put the following code on a Sprite2D and put any gradient not 64x64 pixels in size into "gradient_texture"
Minimal reproduction project
GradientTexture2DBug.zip
The text was updated successfully, but these errors were encountered: