Skip to main content

ResourcePanel

Struct ResourcePanel 

Source
pub struct ResourcePanel {
Show 21 fields pub resizable: [bool; 4], pub background: BackgroundType, pub min_size: [f32; 2], pub max_size: Option<[f32; 2]>, pub movable: [bool; 2], pub scroll_length_method: [Option<ScrollLengthMethod>; 2], pub scroll_sensitivity: f32, pub scroll_bar_display_method: ScrollBarDisplayMethod, pub overall_layout: PanelLayout, pub custom_layout: Vec<CustomPanelLayout>, pub hidden: bool, pub reverse_scroll_direction: [bool; 2], pub inner_margin: [f32; 4], pub raise_on_focus: bool, pub scroll_length: [f32; 2], pub scroll_progress: [f32; 2], pub last_frame_mouse_status: Option<([f32; 2], ClickAim, [f32; 2])>, pub scrolled: [bool; 2], pub scroll_bar_alpha: [u8; 2], pub resource_storage: Vec<PanelStorage>, pub tags: Vec<[String; 2]>,
}
Expand description

Resource panel for organizing and managing UI elements with scrolling capabilities.

资源板,用于组织和管理具有滚动能力的UI元素。

Fields§

§resizable: [bool; 4]

Which edges can be resized: [top, bottom, left, right].

哪些边可以调整尺寸:[top, bottom, left, right]。

§background: BackgroundType

Background display for the panel.

面板的背景显示。

§min_size: [f32; 2]

Minimum size constraints for the panel.

面板的最小尺寸限制。

§max_size: Option<[f32; 2]>

Optional maximum size constraints for the panel.

面板的可选最大尺寸限制。

§movable: [bool; 2]

Whether the panel can be moved: [horizontal, vertical].

面板是否可以移动:[horizontal, vertical]。

§scroll_length_method: [Option<ScrollLengthMethod>; 2]

Methods for calculating scroll length: [horizontal, vertical].

计算滚动长度的方法:[horizontal, vertical]。

§scroll_sensitivity: f32

Sensitivity of scrolling interactions.

滚动交互的敏感性。

§scroll_bar_display_method: ScrollBarDisplayMethod

Display behavior of the scroll bar.

显示滚动条的方法。

§overall_layout: PanelLayout

Layout config for resources within the panel.

面板内资源的布局配置。

§custom_layout: Vec<CustomPanelLayout>

Custom layout config of specific resources within the panel.

面板内特定资源的自定义布局配置。

§hidden: bool

Whether the panel is visible.

面板是否可见。

§reverse_scroll_direction: [bool; 2]

Reverse scroll direction: [horizontal, vertical].

反转滚动方向:[horizontal, vertical]。

§inner_margin: [f32; 4]

Inner margin of the panel.

面板内边距。

Use this field to ensure that functions such as resizing can be used normally.

使用此字段以保证缩放等功能可以正常使用。

§raise_on_focus: bool

Whether to place the panel in the front when clicking

是否在点击时将面板前置。

§scroll_length: [f32; 2]

Current scroll length: [horizontal, vertical].

当前滚动长度:[horizontal, vertical]。

§scroll_progress: [f32; 2]

Current scroll progress: [horizontal, vertical].

当前滚动进度:[horizontal, vertical]。

§last_frame_mouse_status: Option<([f32; 2], ClickAim, [f32; 2])>

Mouse state from previous frame: (position, click_aim, scroll_delta).

上一帧的鼠标状态:(位置,点击目标,滚动增量)。

§scrolled: [bool; 2]

Whether scrolling occurred in this frame: [horizontal, vertical].

在这一帧中是否发生了滚动:[horizontal, vertical]。

§scroll_bar_alpha: [u8; 2]

Scroll bar transparency: [horizontal, vertical].

滚动条透明度:[horizontal, vertical]。

§resource_storage: Vec<PanelStorage>

Storage for resource metadata within the panel.

面板内资源元数据的存储。

§tags: Vec<[String; 2]>

Key-value pairs for categorization and metadata.

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

Implementations§

Source§

impl ResourcePanel

Source

pub fn resizable(self, top: bool, bottom: bool, left: bool, right: bool) -> Self

Source

pub fn background(self, background: &BackgroundType) -> Self

Source

pub fn min_size(self, width: f32, height: f32) -> Self

Source

pub fn max_size(self, max_size: Option<[f32; 2]>) -> Self

Source

pub fn movable(self, horizontal: bool, vertical: bool) -> Self

Source

pub fn scroll_length_method( self, horizontal: Option<ScrollLengthMethod>, vertical: Option<ScrollLengthMethod>, ) -> Self

Source

pub fn scroll_sensitivity(self, scroll_sensitivity: f32) -> Self

Source

pub fn scroll_bar_display_method( self, scroll_bar_display_method: ScrollBarDisplayMethod, ) -> Self

Source

pub fn overall_layout(self, overall_layout: PanelLayout) -> Self

Source

pub fn push_custom_layout(self, custom_layout: CustomPanelLayout) -> Self

Source

pub fn custom_layout(self, custom_layout: &[CustomPanelLayout]) -> Self

Source

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

Source

pub fn reverse_scroll_direction(self, horizontal: bool, vertical: bool) -> Self

Source

pub fn inner_margin(self, top: f32, bottom: f32, left: f32, right: f32) -> Self

Source

pub fn raise_on_focus(self, raise_on_focus: bool) -> Self

Source

pub fn tags(self, tags: &[[String; 2]], replace: bool) -> Self

Trait Implementations§

Source§

impl Clone for ResourcePanel

Source§

fn clone(&self) -> ResourcePanel

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 ResourcePanel

Source§

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

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

impl Default for ResourcePanel

Source§

fn default() -> Self

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

impl PartialEq for ResourcePanel

Source§

fn eq(&self, other: &ResourcePanel) -> 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 RustConstructorResource for ResourcePanel

Source§

fn as_any(&self) -> &dyn Any

Returns a reference to the resource as Any for extract the specific type. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns a mutable reference to the resource as Any for extract the specific type. Read more
Source§

fn display_display_info(&self) -> Option<DisplayInfo>

Retrieves the display info field for this resource. Read more
Source§

fn modify_display_info(&mut self, _display_info: DisplayInfo)

Updates the display info field for this resource. Read more
Source§

fn display_tags(&self) -> Vec<[String; 2]>

Returns all tags associated with this resource. Read more
Source§

fn modify_tags(&mut self, tags: &[[String; 2]], replace: bool)

Updates the tags for this resource. Read more
Source§

impl StructuralPartialEq for ResourcePanel

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,