reckfellENGINE

StyleBoxFlat

Texture-free panel with fill, borders, rounded corners and shadow.

On this page
class StyleBoxFlatReckfellSharpInherits StyleBox

Assign StyleBoxFlat to an element’s theme slot, such as panel on PanelContainer or normal on Button. Elements can share this resource; use Duplicate for independent styling. Default fill is gray (0.6, 0.6, 0.6, 1); borders have color (0.8, 0.8, 0.8, 1) but zero width. DrawCenter is enabled. Own-property setters emit Changed even when assigning the same value again.

BorderWidth defines both painted borders and automatic content padding. A negative corresponding ContentMargin uses border thickness; explicit ContentMargin takes priority. For example, borders of 4 on all sides yield style minimum (8, 8), while ContentMarginLeft = 10 changes left padding only. GetBorderWidthMin returns the smallest of four widths rather than Control minimum size.

CornerRadius stores requested pixel radii. Drawing adapts borders and curves to the available rectangle without changing stored properties. A large radius does not increase panel minimum size. CornerDetail sets arc segment count: default 8, range 1–20. Use nonnegative border widths and radii.

AntiAliasing defaults to enabled but applies only to rounded corners or nonzero Skew. An unskewed square-cornered rectangle receives no additional edge feathering. AntiAliasingSize is feather width, default 1, clamped to 0.01–10; drawing accounts for canvas scale. This is local style antialiasing, separate from MSAA/FXAA.

ExpandMargin extends drawing; ShadowSize and ShadowOffset add a decorative shadow. They do not reserve container space or increase ContentMargin. Default ShadowSize = 0 means no shadow even though ShadowColor is already (0, 0, 0, 0.6). Shadow drawing fades towards transparency; ShadowSize is not a Gaussian blur radius. Allow space around the panel when adjacent controls or ClipContents would cover or clip it.

Skew contains vertex-shear coefficients around drawing center, not degree angles or child-Control transforms. DrawCenter = false removes fill while allowing borders and shadow. BorderBlend blends the inner border edge towards BgColor, or transparency without fill. Rounded corners and a transparent center do not automatically change hit areas or clip children.

StyleBox.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

StyleBoxFlatConstructor
# StyleBoxFlat
C#
public StyleBoxFlat();

Creates a gray panel: DrawCenter and AntiAliasing enabled; borders/radii/shadow size/expansion/Skew zero; CornerDetail = 8, AntiAliasingSize = 1.

Properties23

AntiAliasingProperty
# AntiAliasing
C#
public bool AntiAliasing { get; set; }

Local edge antialiasing, default true. Used only for rounded corners or nonzero Skew; disabling it retains AntiAliasingSize.

AntiAliasingSizeProperty
# AntiAliasingSize
C#
public float AntiAliasingSize { get; set; }

Antialiasing feather width, default 1; setter clamps to 0.01–10. Drawing accounts for canvas scale; disabling antialiasing stores but does not apply this width.

BgColorProperty
# BgColor
C#
public Color BgColor { get; set; }

Fill color/alpha, default (0.6, 0.6, 0.6, 1). DrawCenter enables fill; BorderBlend also uses this color at the inner border edge.

BorderBlendProperty
# BorderBlend
C#
public bool BorderBlend { get; set; }

Blends BorderColor towards BgColor across border thickness; default false. With DrawCenter = false, the inner edge becomes transparent. Does not change width or padding.

BorderColorProperty
# BorderColor
C#
public Color BorderColor { get; set; }

Border color/alpha, default (0.8, 0.8, 0.8, 1). Zero BorderWidth values produce no border.

BorderWidthBottomProperty
# BorderWidthBottom
C#
public int BorderWidthBottom { get; set; }

Bottom border width in pixels, default 0. Use a nonnegative value; supplies automatic padding for this side when ContentMargin is negative.

BorderWidthLeftProperty
# BorderWidthLeft
C#
public int BorderWidthLeft { get; set; }

Left border width in pixels, default 0. Use a nonnegative value; supplies automatic padding for this side when ContentMargin is negative.

BorderWidthRightProperty
# BorderWidthRight
C#
public int BorderWidthRight { get; set; }

Right border width in pixels, default 0. Use a nonnegative value; supplies automatic padding for this side when ContentMargin is negative.

BorderWidthTopProperty
# BorderWidthTop
C#
public int BorderWidthTop { get; set; }

Top border width in pixels, default 0. Use a nonnegative value; supplies automatic padding for this side when ContentMargin is negative.

CornerDetailProperty
# CornerDetail
C#
public int CornerDetail { get; set; }

Segment count per rounded-corner arc; default 8, setter clamps to 1–20. Does not set radius, texture resolution or feather width.

CornerRadiusBottomLeftProperty
# CornerRadiusBottomLeft
C#
public int CornerRadiusBottomLeft { get; set; }

Requested BottomLeft corner radius in pixels, default 0. Use a nonnegative value; drawing adapts to size without changing this property. Does not clip children.

CornerRadiusBottomRightProperty
# CornerRadiusBottomRight
C#
public int CornerRadiusBottomRight { get; set; }

Requested BottomRight corner radius in pixels, default 0. Use a nonnegative value; drawing adapts to size without changing this property. Does not clip children.

CornerRadiusTopLeftProperty
# CornerRadiusTopLeft
C#
public int CornerRadiusTopLeft { get; set; }

Requested TopLeft corner radius in pixels, default 0. Use a nonnegative value; drawing adapts to size without changing this property. Does not clip children.

CornerRadiusTopRightProperty
# CornerRadiusTopRight
C#
public int CornerRadiusTopRight { get; set; }

Requested TopRight corner radius in pixels, default 0. Use a nonnegative value; drawing adapts to size without changing this property. Does not clip children.

DrawCenterProperty
# DrawCenter
C#
public bool DrawCenter { get; set; }

Draw fill, default true. false does not remove borders, shadow, padding or the Control input area.

ExpandMarginBottomProperty
# ExpandMarginBottom
C#
public float ExpandMarginBottom { get; set; }

Bottom drawing expansion in pixels, default 0. Does not increase padding or minimum size; use a finite value.

ExpandMarginLeftProperty
# ExpandMarginLeft
C#
public float ExpandMarginLeft { get; set; }

Left drawing expansion in pixels, default 0. Does not increase padding or minimum size; use a finite value.

ExpandMarginRightProperty
# ExpandMarginRight
C#
public float ExpandMarginRight { get; set; }

Right drawing expansion in pixels, default 0. Does not increase padding or minimum size; use a finite value.

ExpandMarginTopProperty
# ExpandMarginTop
C#
public float ExpandMarginTop { get; set; }

Top drawing expansion in pixels, default 0. Does not increase padding or minimum size; use a finite value.

ShadowColorProperty
# ShadowColor
C#
public Color ShadowColor { get; set; }

Decorative shadow color/alpha, default (0, 0, 0, 0.6). A positive ShadowSize is required to draw it.

ShadowOffsetProperty
# ShadowOffset
C#
public Vector2 ShadowOffset { get; set; }

Shadow offset in local pixels, default Vector2.Zero. Does not move fill, borders, children or padding.

ShadowSizeProperty
# ShadowSize
C#
public int ShadowSize { get; set; }

Fading-shadow expansion in pixels; default 0 disables it. Use a nonnegative value. Does not reserve padding or set Gaussian blur.

SkewProperty
# Skew
C#
public Vector2 Skew { get; set; }

Drawing vertex-shear coefficients, default Vector2.Zero: x adds -Skew.X × (y - centerY), y adds -Skew.Y × (x - centerX). These are not degree angles or child layout. Use finite values.

Methods32

GetAASizefloat
# GetAASize
C#
public float GetAASize();

Antialiasing feather width, default 1; setter clamps to 0.01–10. Drawing accounts for canvas scale; disabling antialiasing stores but does not apply this width.

Returns float

Stored feather width in range 0.01–10.

GetBgColorColor
# GetBgColor
C#
public Color GetBgColor();

Fill color/alpha, default (0.6, 0.6, 0.6, 1). DrawCenter enables fill; BorderBlend also uses this color at the inner border edge.

Returns Color

Fill color/alpha.

GetBorderBlendbool
# GetBorderBlend
C#
public bool GetBorderBlend();

Blends BorderColor towards BgColor across border thickness; default false. With DrawCenter = false, the inner edge becomes transparent. Does not change width or padding.

Returns bool

true when blending towards the inner color is enabled.

GetBorderColorColor
# GetBorderColor
C#
public Color GetBorderColor();

Border color/alpha, default (0.8, 0.8, 0.8, 1). Zero BorderWidth values produce no border.

Returns Color

Border color/alpha.

GetBorderWidthint
# GetBorderWidth
C#
public int GetBorderWidth(Side margin);

Returns the requested border width for a side in pixels. Actual drawn thickness may be reduced in a small rectangle.

Parameters
NameTypeDefault
marginSide—
margin

Side.Left, Top, Right or Bottom.

Returns int

Requested side border width in pixels.

GetBorderWidthMinint
# GetBorderWidthMin
C#
public int GetBorderWidthMin();

Returns the smallest of four stored border widths. Does not return panel minimum Vector2 or account for ContentMargin.

Returns int

Smallest of four stored border widths.

GetCornerDetailint
# GetCornerDetail
C#
public int GetCornerDetail();

Segment count per rounded-corner arc; default 8, setter clamps to 1–20. Does not set radius, texture resolution or feather width.

Returns int

Arc segment count, 1–20.

GetCornerRadiusint
# GetCornerRadius
C#
public int GetCornerRadius(Corner corner);

Returns the stored corner radius in pixels. Drawn radius may be adapted to available size.

Parameters
NameTypeDefault
cornerCorner—
corner

Corner.TopLeft, TopRight, BottomRight or BottomLeft.

Returns int

Requested selected-corner radius in pixels.

GetExpandMarginfloat
# GetExpandMargin
C#
public float GetExpandMargin(Side margin);

Returns stored side drawing expansion in pixels rather than content padding.

Parameters
NameTypeDefault
marginSide—
margin

Side.Left, Top, Right or Bottom.

Returns float

Selected-side drawing expansion in pixels.

GetShadowColorColor
# GetShadowColor
C#
public Color GetShadowColor();

Decorative shadow color/alpha, default (0, 0, 0, 0.6). A positive ShadowSize is required to draw it.

Returns Color

Shadow color/alpha.

GetShadowOffsetVector2
# GetShadowOffset
C#
public Vector2 GetShadowOffset();

Shadow offset in local pixels, default Vector2.Zero. Does not move fill, borders, children or padding.

Returns Vector2

Shadow offset in local pixels.

GetShadowSizeint
# GetShadowSize
C#
public int GetShadowSize();

Fading-shadow expansion in pixels; default 0 disables it. Use a nonnegative value. Does not reserve padding or set Gaussian blur.

Returns int

Stored shadow expansion in pixels.

GetSkewVector2
# GetSkew
C#
public Vector2 GetSkew();

Drawing vertex-shear coefficients, default Vector2.Zero: x adds -Skew.X × (y - centerY), y adds -Skew.Y × (x - centerX). These are not degree angles or child layout. Use finite values.

Returns Vector2

Vertex-shear coefficients (X, Y).

IsAntiAliasedbool
# IsAntiAliased
C#
public bool IsAntiAliased();

Local edge antialiasing, default true. Used only for rounded corners or nonzero Skew; disabling it retains AntiAliasingSize.

Returns bool

Stored local antialiasing flag.

IsDrawCenterEnabledbool
# IsDrawCenterEnabled
C#
public bool IsDrawCenterEnabled();

Draw fill, default true. false does not remove borders, shadow, padding or the Control input area.

Returns bool

true when center fill is enabled.

SetAASizevoid
# SetAASize
C#
public void SetAASize(float size);

Antialiasing feather width, default 1; setter clamps to 0.01–10. Drawing accounts for canvas scale; disabling antialiasing stores but does not apply this width.

Parameters
NameTypeDefault
sizefloat—
size

Antialiasing feather width, default 1; setter clamps to 0.01–10. Drawing accounts for canvas scale; disabling antialiasing stores but does not apply this width.

SetAntiAliasedvoid
# SetAntiAliased
C#
public void SetAntiAliased(bool antiAliased);

Local edge antialiasing, default true. Used only for rounded corners or nonzero Skew; disabling it retains AntiAliasingSize.

Parameters
NameTypeDefault
antiAliasedbool—
antiAliased

Local edge antialiasing, default true. Used only for rounded corners or nonzero Skew; disabling it retains AntiAliasingSize.

SetBgColorvoid
# SetBgColor
C#
public void SetBgColor(Color color);

Fill color/alpha, default (0.6, 0.6, 0.6, 1). DrawCenter enables fill; BorderBlend also uses this color at the inner border edge.

Parameters
NameTypeDefault
colorColor—
color

Fill color/alpha, default (0.6, 0.6, 0.6, 1). DrawCenter enables fill; BorderBlend also uses this color at the inner border edge.

SetBorderBlendvoid
# SetBorderBlend
C#
public void SetBorderBlend(bool blend);

Blends BorderColor towards BgColor across border thickness; default false. With DrawCenter = false, the inner edge becomes transparent. Does not change width or padding.

Parameters
NameTypeDefault
blendbool—
blend

Blends BorderColor towards BgColor across border thickness; default false. With DrawCenter = false, the inner edge becomes transparent. Does not change width or padding.

SetBorderColorvoid
# SetBorderColor
C#
public void SetBorderColor(Color color);

Border color/alpha, default (0.8, 0.8, 0.8, 1). Zero BorderWidth values produce no border.

Parameters
NameTypeDefault
colorColor—
color

Border color/alpha, default (0.8, 0.8, 0.8, 1). Zero BorderWidth values produce no border.

SetBorderWidthvoid
# SetBorderWidth
C#
public void SetBorderWidth(Side margin, int width);

Sets side border width in pixels and emits Changed. Use a nonnegative value. Also changes padding/minimum when ContentMargin is automatic.

Parameters
NameTypeDefault
marginSide—
widthint—
margin

Side.Left, Top, Right or Bottom.

width

Sets side border width in pixels and emits Changed. Use a nonnegative value. Also changes padding/minimum when ContentMargin is automatic.

SetBorderWidthAllvoid
# SetBorderWidthAll
C#
public void SetBorderWidthAll(int width);

Sets the same width on all four borders and emits Changed once. Explicit ContentMargin values are not overwritten.

Parameters
NameTypeDefault
widthint—
width

Sets the same width on all four borders and emits Changed once. Explicit ContentMargin values are not overwritten.

SetCornerDetailvoid
# SetCornerDetail
C#
public void SetCornerDetail(int detail);

Segment count per rounded-corner arc; default 8, setter clamps to 1–20. Does not set radius, texture resolution or feather width.

Parameters
NameTypeDefault
detailint—
detail

Segment count per rounded-corner arc; default 8, setter clamps to 1–20. Does not set radius, texture resolution or feather width.

SetCornerRadiusvoid
# SetCornerRadius
C#
public void SetCornerRadius(Corner corner, int radius);

Sets selected-corner radius in pixels and emits Changed. Use a nonnegative value; minimum size and hit area do not grow.

Parameters
NameTypeDefault
cornerCorner—
radiusint—
corner

Corner.TopLeft, TopRight, BottomRight or BottomLeft.

radius

Sets selected-corner radius in pixels and emits Changed. Use a nonnegative value; minimum size and hit area do not grow.

SetCornerRadiusAllvoid
# SetCornerRadiusAll
C#
public void SetCornerRadiusAll(int radius);

Sets one radius on all four corners and emits Changed once. Drawing fits curves to the rectangle without changing stored radii.

Parameters
NameTypeDefault
radiusint—
radius

Sets one radius on all four corners and emits Changed once. Drawing fits curves to the rectangle without changing stored radii.

SetDrawCentervoid
# SetDrawCenter
C#
public void SetDrawCenter(bool drawCenter);

Draw fill, default true. false does not remove borders, shadow, padding or the Control input area.

Parameters
NameTypeDefault
drawCenterbool—
drawCenter

Draw fill, default true. false does not remove borders, shadow, padding or the Control input area.

SetExpandMarginvoid
# SetExpandMargin
C#
public void SetExpandMargin(Side margin, float size);

Sets drawing overflow beyond a rect side in pixels and emits Changed. Positive values expand drawing without increasing minimum size; use a finite value.

Parameters
NameTypeDefault
marginSide—
sizefloat—
margin

Side.Left, Top, Right or Bottom.

size

Sets drawing overflow beyond a rect side in pixels and emits Changed. Positive values expand drawing without increasing minimum size; use a finite value.

SetExpandMarginAllvoid
# SetExpandMarginAll
C#
public void SetExpandMarginAll(float size);

Sets one drawing expansion on all sides and emits Changed once. The container does not reserve this area; use a finite value.

Parameters
NameTypeDefault
sizefloat—
size

Sets one drawing expansion on all sides and emits Changed once. The container does not reserve this area; use a finite value.

SetShadowColorvoid
# SetShadowColor
C#
public void SetShadowColor(Color color);

Decorative shadow color/alpha, default (0, 0, 0, 0.6). A positive ShadowSize is required to draw it.

Parameters
NameTypeDefault
colorColor—
color

Decorative shadow color/alpha, default (0, 0, 0, 0.6). A positive ShadowSize is required to draw it.

SetShadowOffsetvoid
# SetShadowOffset
C#
public void SetShadowOffset(Vector2 offset);

Shadow offset in local pixels, default Vector2.Zero. Does not move fill, borders, children or padding.

Parameters
NameTypeDefault
offsetVector2—
offset

Shadow offset in local pixels, default Vector2.Zero. Does not move fill, borders, children or padding.

SetShadowSizevoid
# SetShadowSize
C#
public void SetShadowSize(int size);

Fading-shadow expansion in pixels; default 0 disables it. Use a nonnegative value. Does not reserve padding or set Gaussian blur.

Parameters
NameTypeDefault
sizeint—
size

Fading-shadow expansion in pixels; default 0 disables it. Use a nonnegative value. Does not reserve padding or set Gaussian blur.

SetSkewvoid
# SetSkew
C#
public void SetSkew(Vector2 skew);

Drawing vertex-shear coefficients, default Vector2.Zero: x adds -Skew.X × (y - centerY), y adds -Skew.Y × (x - centerX). These are not degree angles or child layout. Use finite values.

Parameters
NameTypeDefault
skewVector2—
skew

Drawing vertex-shear coefficients, default Vector2.Zero: x adds -Skew.X × (y - centerY), y adds -Skew.Y × (x - centerX). These are not degree angles or child layout. Use finite values.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.