Struct gdnative_bindings_lily::StyleBoxFlat[][src]

pub struct StyleBoxFlat { /* fields omitted */ }
Expand description

core class StyleBoxFlat inherits StyleBox (reference counted).

Official documentation

See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.

Memory management

The lifetime of this object is automatically managed through reference counting.

Class hierarchy

StyleBoxFlat inherits methods from:

Safety

All types in the Godot API have “interior mutability” in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

Creates a new instance of this object.

This is a reference-counted type. The returned object is automatically managed by Ref.

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

The background color of the stylebox.

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

Sets the color of the border.

Border width for the top border.

Returns the smallest border width out of all four borders.

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 ([method set_corner_radius_all]) 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.

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

Expands the stylebox outside of the control rect on the top edge. Useful in combination with [member border_width_top] to draw a border outside the control rect.

The color of the shadow. This has no effect if [member shadow_size] is lower than 1.

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

The shadow size in pixels.

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.

Toggles drawing of the inner part of the stylebox.

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

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.

The background color of the stylebox.

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

Sets the color of the border.

Border width for the top border.

Sets the border width to width pixels for all margins.

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 ([method set_corner_radius_all]) 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.

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

Sets the corner radius to radius pixels for all corners.

Sets the corner radius for each corner to radius_top_left, radius_top_right, radius_bottom_right, and radius_bottom_left pixels.

Toggles drawing of the inner part of the stylebox.

Expands the stylebox outside of the control rect on the top edge. Useful in combination with [member border_width_top] to draw a border outside the control rect.

Sets the expand margin to size pixels for all margins.

Sets the expand margin for each margin to size_left, size_top, size_right, and size_bottom pixels.

The color of the shadow. This has no effect if [member shadow_size] is lower than 1.

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

The shadow size in pixels.

Methods from Deref<Target = StyleBox>

Draws this stylebox using a CanvasItem with given [RID]. You can get a [RID] value using [method Object.get_instance_id] on a CanvasItem-derived node.

Returns the size of this StyleBox without the margins.

Returns the CanvasItem that handles its [constant CanvasItem.NOTIFICATION_DRAW] or [method CanvasItem._draw] callback at this moment.

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 [member content_margin_bottom] for extra considerations.

Returns the content margin offset for the specified [enum Margin]. Positive values reduce size inwards, unlike Control’s margin values.

Returns the minimum size that this stylebox can be shrunk to.

Returns the “offset” of a stylebox. This helper function returns a value equivalent to Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP)).

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 [member content_margin_bottom] for extra considerations.

Test a position in a rectangle, return whether it passes the mask test.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

Creates an explicitly null reference of Self as a method argument. This makes type inference easier for the compiler compared to Option. Read more

Creates a new instance of Self using a zero-argument constructor, as a Unique reference. Read more

Performs a dynamic reference downcast to target type. Read more

Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more

Creates a persistent reference to the same Godot object with shared thread access. Read more

Creates a persistent reference to the same Godot object with thread-local thread access. Read more

Creates a persistent reference to the same Godot object with unique access. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive. See also TRef::try_from_instance_id. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive, and panics otherwise. This does NOT guarantee that the resulting reference is safe to use. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.