[−][src]Struct gdnative_bindings::style_box_flat::StyleBoxFlat
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]
&self,
radius_top_left: i64,
radius_top_right: i64,
radius_bottom_right: i64,
radius_bottom_left: i64
)
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]
&self,
size_left: f64,
size_top: f64,
size_right: f64,
size_bottom: f64
)
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]
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
fn class_name() -> &'static str[src]
fn null() -> Null<Self>[src]
fn new() -> Ref<Self, Unique> where
Self: Instanciable, [src]
Self: Instanciable,
fn cast<T>(&self) -> Option<&T> where
T: GodotObject + SubClass<Self>, [src]
T: GodotObject + SubClass<Self>,
fn upcast<T>(&self) -> &T where
Self: SubClass<T>,
T: GodotObject, [src]
Self: SubClass<T>,
T: GodotObject,
unsafe fn assume_shared(&self) -> Ref<Self, Shared>[src]
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>, [src]
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_unique(&self) -> Ref<Self, Unique>[src]
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
impl RefUnwindSafe for StyleBoxFlat
impl !Send for StyleBoxFlat
impl !Sync for StyleBoxFlat
impl Unpin for StyleBoxFlat
impl UnwindSafe for StyleBoxFlat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> SubClass<T> for T where
T: GodotObject, [src]
T: GodotObject,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,