Is there an option to select a vertical gradient in "GradientTexture"?
Was trying to style my buttons with a vertical gradient but i cant find any option to change it from horistontal to vertical direction (from top to bottom or bottom to top). Se screenshot below:
However, now i can no longer change border, corner radius, shadow etc of the button when its a StyleBoxTexture (Instead of StyleBoxFlat)and GradientTexture2D. Or how do change it now when my button has a gradient? It seems like StyleBoxFlat cant have a gradient?
Yeah, StyleBoxTexture doesn’t have the border, corner radius, etc properties (since you could put those onto the texture itself) and StyleBoxFlat doesn’t have a gradient option.
Not sure what you mean by “since you could put those onto the texture itself”.
How do I add rounded corners, border and shadow to my gradient button then? Cause I find no way to “put those onto” my gradient button (StyleBoxTexture and GradientTexture2D)
You need the PanelContainer as a parent of Button so that its corners don’t stick beyond the rounded corners. You need the second PanelContainer as a sibling to the first, lower down, so that the Buttoncorners don’t stick into the outline.
Wow! That was alot of work for achiving that. Would have been much easier and faster if Godot just had an option for gradient on the StyleBoxFlat or the button. Maybe there is a plugin for this? Or is this fixed in newer versions of godot?
This was just me having fun before bed trying to solve your problem.
You could conceivably make your own using this method. Create the button, clear out the text (maybe using spaces to get the size you want - or playing with the minimum size values), take a screen shot, then use that as the texture. You’ll have to import the screen shot into GIMP or Krita and turn the corners transparent, but that’s easy enough to do.
I was using the latest version of Godot, 4.6, in my example.