Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

StyleBoxFlat

Inherits: StyleBox < Resource < RefCounted < Object

A customizable StyleBox that doesn't use a texture.

Description

By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew.

Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system.

Example:

height = 30
corner_radius_top_left = 50
corner_radius_bottom_left = 100

The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will never be more than the height. Result:

corner_radius_top_left: 10
corner_radius_bottom_left: 20

Properties

bool

anti_aliasing

true

float

anti_aliasing_size

1.0

Color

bg_color

Color(0.6, 0.6, 0.6, 1)

bool

border_blend

false

Color

border_color

Color(0.8, 0.8, 0.8, 1)

int

border_width_bottom

0

int

border_width_left

0

int

border_width_right

0

int

border_width_top

0

int

corner_detail

8

int

corner_radius_bottom_left

0

int

corner_radius_bottom_right

0

int

corner_radius_top_left

0

int

corner_radius_top_right

0

bool

draw_center

true

float