Skip to main content

CustomRectConfig

Struct CustomRectConfig 

Source
pub struct CustomRectConfig {
Show 16 fields pub position_size_config: Option<PositionSizeConfig>, pub clip_rect: Option<Option<PositionSizeConfig>>, pub hidden: Option<bool>, pub ignore_render_layer: Option<bool>, pub rounding: Option<f32>, pub color: Option<[u8; 3]>, pub alpha: Option<u8>, pub overlay_color: Option<[u8; 3]>, pub overlay_alpha: Option<Option<u8>>, pub border_width: Option<f32>, pub border_color: Option<[u8; 3]>, pub border_alpha: Option<u8>, pub overlay_border_color: Option<[u8; 3]>, pub overlay_border_alpha: Option<Option<u8>>, pub border_kind: Option<BorderKind>, pub tags: Option<Vec<[String; 2]>>,
}
Expand description

Config options for custom rectangles.

矩形的可配置选项。

This struct contains all configurable properties for creating and modifying rectangular UI elements with various visual properties.

该结构体包含用于创建和修改具有各种视觉属性的矩形UI元素的所有可配置属性。

Fields§

§position_size_config: Option<PositionSizeConfig>

Config for position, size, and layout of the rectangle.

矩形的位置、尺寸和布局配置。

§clip_rect: Option<Option<PositionSizeConfig>>

Optional clipping rectangle that defines the visible area.

定义可见区域的可选裁剪矩形。

§hidden: Option<bool>

Controls whether the rectangle is visible or hidden.

控制矩形是否可见或隐藏。

§ignore_render_layer: Option<bool>

If true, the rectangle ignores render layer.

如果为true,矩形忽略渲染层。

§rounding: Option<f32>

Radius for rounded corners. Zero for sharp corners.

圆角半径。零表示直角。

§color: Option<[u8; 3]>

Fill color of the rectangle as [R, G, B].

矩形的填充颜色,格式为[R, G, B]。

§alpha: Option<u8>

Opacity of the rectangle (0-255).

矩形的不透明度(0-255)。

§overlay_color: Option<[u8; 3]>

Fill color overlay of the rectangle as [R, G, B].

矩形的填充颜色覆盖层,格式为[R, G, B]。

§overlay_alpha: Option<Option<u8>>

Opacity of the fill color overlay (0-255).

矩形的填充颜色覆盖层不透明度(0-255)。

§border_width: Option<f32>

Width of the border.

边框宽度。

§border_color: Option<[u8; 3]>

Color of the border as [R, G, B].

边框颜色,格式为[R, G, B]。

§border_alpha: Option<u8>

Opacity of the border (0-255).

边框的不透明度(0-255)。

§overlay_border_color: Option<[u8; 3]>

Color overlay of the border as [R, G, B].

边框的颜色覆盖层,格式为[R, G, B]。

§overlay_border_alpha: Option<Option<u8>>

Opacity of the border color overlay (0-255).

边框的颜色覆盖层不透明度(0-255)。

§border_kind: Option<BorderKind>

Placement of the border relative to the rectangle’s bounds.

边框相对于矩形边界的放置方式。

§tags: Option<Vec<[String; 2]>>

Key-value pairs for categorization and metadata.

用于分类和元数据的键值对标签。

Implementations§

Source§

impl CustomRectConfig

Source

pub fn from_custom_rect(custom_rect: &CustomRect) -> Self

Source

pub fn position_size_config( self, position_size_config: Option<PositionSizeConfig>, ) -> Self

Source

pub fn clip_rect(self, clip_rect: Option<Option<PositionSizeConfig>>) -> Self

Source

pub fn hidden(self, hidden: Option<bool>) -> Self

Source

pub fn ignore_render_layer(self, ignore_render_layer: Option<bool>) -> Self

Source

pub fn rounding(self, rounding: Option<f32>) -> Self

Source

pub fn color(self, color: Option<[u8; 3]>) -> Self

Source

pub fn alpha(self, alpha: Option<u8>) -> Self

Source

pub fn overlay_color(self, overlay_color: Option<[u8; 3]>) -> Self

Source

pub fn overlay_alpha(self, overlay_alpha: Option<Option<u8>>) -> Self

Source

pub fn border_width(self, border_width: Option<f32>) -> Self

Source

pub fn border_color(self, border_color: Option<[u8; 3]>) -> Self

Source

pub fn border_alpha(self, border_alpha: Option<u8>) -> Self

Source

pub fn overlay_border_color(self, overlay_border_color: Option<[u8; 3]>) -> Self

Source

pub fn overlay_border_alpha( self, overlay_border_alpha: Option<Option<u8>>, ) -> Self

Source

pub fn border_kind(self, border_kind: Option<BorderKind>) -> Self

Source

pub fn tags(self, tags: Option<Vec<[String; 2]>>) -> Self

Trait Implementations§

Source§

impl Clone for CustomRectConfig

Source§

fn clone(&self) -> CustomRectConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CustomRectConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CustomRectConfig

Source§

fn default() -> CustomRectConfig

Returns the “default value” for a type. Read more
Source§

impl PartialEq for CustomRectConfig

Source§

fn eq(&self, other: &CustomRectConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for CustomRectConfig

Source§

fn partial_cmp(&self, other: &CustomRectConfig) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for CustomRectConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,