Struct StyleBoxFlat
Customizable StyleBox with a given set of parameters (no texture required).
struct StyleBoxFlat
;
This StyleBox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
- Color
- Border width (individual width for each border)
- Rounded corners (individual radius for each corner)
- Shadow (with blur and offset)
Setting corner radius to high values is allowed. As soon as corners would 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:
Properties
| Name | Type | Description |
|---|---|---|
antiAliasing[get, set]
|
bool | 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. |
antiAliasingSize[get, set]
|
long | This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. |
bgColor[get, set]
|
Color | The background color of the stylebox. |
borderBlend[get, set]
|
bool | If true, the border will fade into the background color.
|
borderColor[get, set]
|
Color | Sets the color of the border. |
borderWidthBottom[get, set]
|
long | Border width for the bottom border. |
borderWidthLeft[get, set]
|
long | Border width for the left border. |
borderWidthRight[get, set]
|
long | Border width for the right border. |
borderWidthTop[get, set]
|
long | Border width for the top border. |
cornerDetail[get, set]
|
long | This sets the amount 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) into account.
For corner radii smaller than 10, 4 or 5 should be enough. For corner radii smaller 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.
|
cornerRadiusBottomLeft[get, set]
|
long | The bottom-left corner's radius. If 0, the corner is not rounded.
|
cornerRadiusBottomRight[get, set]
|
long | The bottom-right corner's radius. If 0, the corner is not rounded.
|
cornerRadiusTopLeft[get, set]
|
long | The top-left corner's radius. If 0, the corner is not rounded.
|
cornerRadiusTopRight[get, set]
|
long | The top-right corner's radius. If 0, the corner is not rounded.
|
drawCenter[get, set]
|
bool | Toggles drawing of the inner part of the stylebox. |
expandMarginBottom[get, set]
|
double | 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.
|
expandMarginLeft[get, set]
|
double | 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.
|
expandMarginRight[get, set]
|
double | 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.
|
expandMarginTop[get, set]
|
double | 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.
|
shadowColor[get, set]
|
Color | The color of the shadow. This has no effect if shadowSize is lower than 1.
|
shadowOffset[get, set]
|
Vector2 | The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox. |
shadowSize[get, set]
|
long | The shadow size in pixels. |
Methods
| Name | Description |
|---|---|
getAaSize
|
|
getBgColor
|
|
getBorderBlend
|
|
getBorderColor
|
|
getBorderWidth
|
Returns the given margin's border width. See margin for possible values.
|
getBorderWidthMin
|
Returns the smallest border width out of all four borders. |
getCornerDetail
|
|
getCornerRadius
|
Returns the given corner's radius. See corner for possible values.
|
getExpandMargin
|
Returns the size of the given margin's expand margin. See margin for possible values.
|
getShadowColor
|
|
getShadowOffset
|
|
getShadowSize
|
|
isAntiAliased
|
|
isDrawCenterEnabled
|
|
setAaSize
|
|
setAntiAliased
|
|
setBgColor
|
|
setBorderBlend
|
|
setBorderColor
|
|
setBorderWidth
|
Sets the border width to width pixels for the given margin. See margin for possible values.
|
setBorderWidthAll
|
Sets the border width to width pixels for all margins.
|
setCornerDetail
|
|
setCornerRadius
|
Sets the corner radius to radius pixels for the given corner. See corner for possible values.
|
setCornerRadiusAll
|
Sets the corner radius to radius pixels for all corners.
|
setCornerRadiusIndividual
|
Sets the corner radius for each corner to radius_top_left, radius_top_right, radius_bottom_right, and radius_bottom_left pixels.
|
setDrawCenter
|
|
setExpandMargin
|
Sets the expand margin to size pixels for the given margin. See margin for possible values.
|
setExpandMarginAll
|
Sets the expand margin to size pixels for all margins.
|
setExpandMarginIndividual
|
Sets the expand margin for each margin to size_left, size_top, size_right, and size_bottom pixels.
|
setShadowColor
|
|
setShadowOffset
|
|
setShadowSize
|
corner radius top left
10
corner radius bottom left
20