Click or drag to resize

StyleBoxFlat Properties

The StyleBoxFlat type exposes the following members.

Properties
  NameDescription
Public propertyAntiAliasing

Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners.

Public propertyAntiAliasingSize

This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect.

Public propertyBgColor

The background color of the stylebox.

Public propertyBorderBlend

If true, the border will fade into the background color.

Public propertyBorderColor

Sets the color of the border.

Public propertyBorderWidthBottom

Border width for the bottom border.

Public propertyBorderWidthLeft

Border width for the left border.

Public propertyBorderWidthRight

Border width for the right border.

Public propertyBorderWidthTop

Border width for the top border.

Public propertyContentMarginBottom

The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom.

If this value is negative, it is ignored and a child-specific margin is used instead. For example for StyleBoxFlat the border thickness (if any) is used instead.

It is up to the code using this style box to decide what these contents are: for example, a Button respects this content margin for the textual contents of the button.

GetMargin(Margin) should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above.

(Inherited from StyleBox.)
Public propertyContentMarginLeft

The left margin for the contents of this style box.Increasing this value reduces the space available to the contents from the left.

Refer to ContentMarginBottom for extra considerations.

(Inherited from StyleBox.)
Public propertyContentMarginRight

The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right.

Refer to ContentMarginBottom for extra considerations.

(Inherited from StyleBox.)
Public propertyContentMarginTop

The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top.

Refer to ContentMarginBottom for extra considerations.

(Inherited from StyleBox.)
Public propertyCornerDetail

This sets the number of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value, you should take the corner radius (SetCornerRadiusAll(Int32)) into account.

For corner radii less than 10, 4 or 5 should be enough. For corner radii less than 30, values between 8 and 12 should be enough.

A corner detail of 1 will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.

Public propertyCornerRadiusBottomLeft

The bottom-left corner's radius. If 0, the corner is not rounded.

Public propertyCornerRadiusBottomRight

The bottom-right corner's radius. If 0, the corner is not rounded.

Public propertyCornerRadiusTopLeft

The top-left corner's radius. If 0, the corner is not rounded.

Public propertyCornerRadiusTopRight

The top-right corner's radius. If 0, the corner is not rounded.

Public propertyDrawCenter

Toggles drawing of the inner part of the stylebox.

Public propertyDynamicObject
Gets a new DynamicGodotObject associated with this instance.
(Inherited from Object.)
Public propertyExpandMarginBottom

Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with BorderWidthBottom to draw a border outside the control rect.

Public propertyExpandMarginLeft

Expands the stylebox outside of the control rect on the left edge. Useful in combination with BorderWidthLeft to draw a border outside the control rect.

Public propertyExpandMarginRight

Expands the stylebox outside of the control rect on the right edge. Useful in combination with BorderWidthRight to draw a border outside the control rect.

Public propertyExpandMarginTop

Expands the stylebox outside of the control rect on the top edge. Useful in combination with BorderWidthTop to draw a border outside the control rect.

Public propertyNativeInstance (Inherited from Object.)
Public propertyResourceLocalToScene

If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

(Inherited from Resource.)
Public propertyResourceName

The name of the resource. This is an optional identifier. If ResourceName is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the ResourceName will be displayed as the tab name in the script editor.

(Inherited from Resource.)
Public propertyResourcePath

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

(Inherited from Resource.)
Public propertyShadowColor

The color of the shadow. This has no effect if ShadowSize is lower than 1.

Public propertyShadowOffset

The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox.

Public propertyShadowSize

The shadow size in pixels.

Top
See Also