ControlAddStyleboxOverride Method |
Overrides the StyleBox with given name in the Theme resource the control uses. If stylebox is empty or invalid, the override is cleared and the StyleBox from assigned Theme is used.
Example of modifying a property in a StyleBox by duplicating it:
# The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. # Resources are shared across instances, so we need to duplicate it # to avoid modifying the appearance of all other buttons. var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate() new_stylebox_normal.border_width_top = 3 new_stylebox_normal.border_color = Color(0, 1, 0.5) $MyButton.add_stylebox_override("normal", new_stylebox_normal) # Remove the stylebox override: $MyButton.add_stylebox_override("normal", null)
Namespace: Godot
public void AddStyleboxOverride( string name, StyleBox stylebox )
[Missing <param name="name"/> documentation for "M:Godot.Control.AddStyleboxOverride(System.String,Godot.StyleBox)"]
[Missing <param name="stylebox"/> documentation for "M:Godot.Control.AddStyleboxOverride(System.String,Godot.StyleBox)"]