Material Box

Material Box

WEB Design & Material Images

Godot - Changing the Font Size of a Button

Godot

This code example shows how to change the font size of a Button node using GDScript.


To change the font size of a Button node, use `add_theme_font_size_override()` and specify the value for the `font_size` property.
When you change the font size of a Button node, the size of the button itself will change to fit the size of the entire text.

# Create a Button node
var button = Button.new()
add_child(button)
button.set_text("Button")

# Change the font size
button.add_theme_font_size_override("font_size", 30)

Godot

TitleGodot - Changing the Font Size of a Button

CategoryGodot

Created

Update

AuthorYousuke.U