[][src]Struct gdnative_bindings::StyleBoxFlat

pub struct StyleBoxFlat { /* fields omitted */ }

core class StyleBoxFlat inherits StyleBox (reference counted).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

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

impl StyleBoxFlat[src]

pub fn new() -> Ref<Self, Unique>[src]

Creates a new instance of this object.

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

pub fn aa_size(&self) -> i64[src]

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

pub fn bg_color(&self) -> Color[src]

The background color of the stylebox.

pub fn border_blend(&self) -> bool[src]

If [code]true[/code], the border will fade into the background color.

pub fn border_color(&self) -> Color[src]

Sets the color of the border.

pub fn border_width(&self, margin: i64) -> i64[src]

Border width for the top border.

pub fn get_border_width_min(&self) -> i64[src]

Returns the smallest border width out of all four borders.

pub fn corner_detail(&self) -> i64[src]

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, [code]4[/code] or [code]5[/code] should be enough. For corner radii smaller than 30, values between [code]8[/code] and [code]12[/code] should be enough.
			A corner detail of [code]1[/code] will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.

pub fn corner_radius(&self, corner: i64) -> i64[src]

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

pub fn expand_margin(&self, margin: i64) -> f64[src]

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.

pub fn shadow_color(&self) -> Color[src]

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

pub fn shadow_offset(&self) -> Vector2[src]

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

pub fn shadow_size(&self) -> i64[src]

The shadow size in pixels.

pub fn is_anti_aliased(&self) -> bool[src]

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.

pub fn is_draw_center_enabled(&self) -> bool[src]

Toggles drawing of the inner part of the stylebox.

pub fn set_aa_size(&self, size: i64)[src]

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

pub fn set_anti_aliased(&self, anti_aliased: bool)[src]

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.

pub fn set_bg_color(&self, color: Color)[src]

The background color of the stylebox.

pub fn set_border_blend(&self, blend: bool)[src]

If [code]true[/code], the border will fade into the background color.

pub fn set_border_color(&self, color: Color)[src]

Sets the color of the border.

pub fn set_border_width(&self, margin: i64, width: i64)[src]

Border width for the top border.

pub fn set_border_width_all(&self, width: i64)[src]

Sets the border width to [code]width[/code] pixels for all margins.

pub fn set_corner_detail(&self, detail: i64)[src]

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, [code]4[/code] or [code]5[/code] should be enough. For corner radii smaller than 30, values between [code]8[/code] and [code]12[/code] should be enough.
			A corner detail of [code]1[/code] will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.

pub fn set_corner_radius(&self, corner: i64, radius: i64)[src]

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

pub fn set_corner_radius_all(&self, radius: i64)[src]

Sets the corner radius to [code]radius[/code] pixels for all corners.

pub fn set_corner_radius_individual(
    &self,
    radius_top_left: i64,
    radius_top_right: i64,
    radius_bottom_right: i64,
    radius_bottom_left: i64
)
[src]

Sets the corner radius for each corner to [code]radius_top_left[/code], [code]radius_top_right[/code], [code]radius_bottom_right[/code], and [code]radius_bottom_left[/code] pixels.

pub fn set_draw_center(&self, draw_center: bool)[src]

Toggles drawing of the inner part of the stylebox.

pub fn set_expand_margin(&self, margin: i64, size: f64)[src]

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.

pub fn set_expand_margin_all(&self, size: f64)[src]

Sets the expand margin to [code]size[/code] pixels for all margins.

pub fn set_expand_margin_individual(
    &self,
    size_left: f64,
    size_top: f64,
    size_right: f64,
    size_bottom: f64
)
[src]

Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels.

pub fn set_shadow_color(&self, color: Color)[src]

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

pub fn set_shadow_offset(&self, offset: Vector2)[src]

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

pub fn set_shadow_size(&self, size: i64)[src]

The shadow size in pixels.

Methods from Deref<Target = StyleBox>

pub fn draw(&self, canvas_item: Rid, rect: Rect2)[src]

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.

pub fn get_center_size(&self) -> Vector2[src]

Returns the size of this [StyleBox] without the margins.

pub fn get_current_item_drawn(&self) -> Option<Ref<CanvasItem, Shared>>[src]

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

pub fn default_margin(&self, margin: i64) -> f64[src]

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.

pub fn get_margin(&self, margin: i64) -> f64[src]

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

pub fn get_minimum_size(&self) -> Vector2[src]

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

pub fn get_offset(&self) -> Vector2[src]

Returns the "offset" of a stylebox. This helper function returns a value equivalent to [code]Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))[/code].

pub fn set_default_margin(&self, margin: i64, offset: f64)[src]

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.

pub fn test_mask(&self, point: Vector2, rect: Rect2) -> bool[src]

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

Trait Implementations

impl Debug for StyleBoxFlat[src]

impl Deref for StyleBoxFlat[src]

type Target = StyleBox

The resulting type after dereferencing.

impl DerefMut for StyleBoxFlat[src]

impl GodotObject for StyleBoxFlat[src]

type RefKind = RefCounted

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

impl Instanciable for StyleBoxFlat[src]

impl Sealed for StyleBoxFlat[src]

impl SubClass<Object> for StyleBoxFlat[src]

impl SubClass<Reference> for StyleBoxFlat[src]

impl SubClass<Resource> for StyleBoxFlat[src]

impl SubClass<StyleBox> for StyleBoxFlat[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.