Material Box

Material Box

WEB Design & Material Images

Godot - Change progress bar color and transparency

Godot

GDScript to change progress bar color and transparency.


It is possible to change the color and transparency of progress bars using StyleBoxFlat.
By specifying "fill" and "background" in add_theme_stylebox_override(), you can enable changing the style of the bar and background style.
Change the color and transparency with the "bg_color" property.

# bar
var bar = StyleBoxFlat.new()
add_theme_stylebox_override('fill', bar)
bar.bg_color = Color('#00ff7f' , 0.5)

# background
var bg = StyleBoxFlat.new()
add_theme_stylebox_override('background', bg)
bg.bg_color = Color('#696969',1)

Godot

TitleGodot - Change progress bar color and transparency

CategoryGodot

Created

Update

AuthorYousuke.U