Material Box

Material Box

WEB Design & Material Images

Godot - Remove progress bar corner radius

Godot

GDScript to remove default corner radius of progress bar.


To remove default corner radius of progress bar node, get theme stylebox with get_theme_stylebox() and change properties to "0".

# Current value bar
var bar = get_theme_stylebox('fill')
bar.corner_radius_bottom_right = 0
bar.corner_radius_bottom_left = 0
bar.corner_radius_top_left = 0
bar.corner_radius_top_right = 0

# Background corner radius
var bg = get_theme_stylebox('background')
bg.corner_radius_bottom_right = 0
bg.corner_radius_bottom_left = 0
bg.corner_radius_top_left = 0
bg.corner_radius_top_right = 0

By assigning new stylebox with add_theme_stylebox_override(), can also remove corner radius but all other default styles will be removed.

# Current value bar
var bar = StyleBoxFlat.new()
add_theme_stylebox_override('fill', bar)

# Background bar
var bg = StyleBoxFlat.new()
add_theme_stylebox_override('background', bg)

set_corner_radius_all() can be used to change 4 corner radius together.

# Current value bar
var bar = StyleBoxFlat.new()
bar.set_corner_radius_all(0)

# Background bar
var bg = StyleBoxFlat.new()
bg.set_corner_radius_all(0)

Godot

TitleGodot - Remove progress bar corner radius

CategoryGodot

Created

Update

AuthorYousuke.U