pub struct Switch {Show 14 fields
pub appearance: Vec<SwitchAppearanceConfig>,
pub background_type: BackgroundType,
pub text_config: TextConfig,
pub hint_text_config: TextConfig,
pub enable_animation: [bool; 2],
pub state_amount: u32,
pub click_method: Vec<SwitchClickConfig>,
pub enable: bool,
pub state: u32,
pub last_frame_hovered: bool,
pub last_frame_clicked: Option<usize>,
pub switched: bool,
pub use_switch_tags: bool,
pub tags: Vec<[String; 2]>,
}Expand description
RC的开关资源。
Fields§
§appearance: Vec<SwitchAppearanceConfig>外观(包括各类资源配置项,数量为开启的内容数量*Switch状态总数)。
background_type: BackgroundTypeBackground显示内容类型。
text_config: TextConfigText显示配置。
hint_text_config: TextConfig提示Text显示配置。
enable_animation: [bool; 2]是否启用鼠标悬浮和点击时的显示内容。
state_amount: u32Switch状态总数。
click_method: Vec<SwitchClickConfig>可以用于点击Switch的方法。
enable: bool是否启用Switch(不启用会显示出填充资源,但无法交互)。
state: u32Switch当前状态。
last_frame_hovered: bool上一帧是否有鼠标悬停。
last_frame_clicked: Option<usize>上一帧是否被鼠标点击。
switched: bool是否切换了Switch状态。
是否让创建的资源使用Switch的标签。
标签。
Implementations§
Source§impl Switch
impl Switch
pub fn appearance(self, appearance: &[SwitchAppearanceConfig]) -> Self
pub fn background_type(self, background_type: &BackgroundType) -> Self
pub fn text_config(self, text_config: &TextConfig) -> Self
pub fn hint_text_config(self, hint_text_config: &TextConfig) -> Self
pub fn enable_animation(self, enable_hover: bool, enable_click: bool) -> Self
pub fn state_amount(self, state_amount: u32) -> Self
pub fn click_method(self, click_method: Vec<SwitchClickConfig>) -> Self
pub fn enable(self, enable: bool) -> Self
Trait Implementations§
Source§impl RustConstructorResource for Switch
impl RustConstructorResource for Switch
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
用于可变类型转换。
Source§fn display_display_info(&self) -> Option<DisplayInfo>
fn display_display_info(&self) -> Option<DisplayInfo>
显示显示信息。
Source§fn modify_display_info(&mut self, _display_info: DisplayInfo)
fn modify_display_info(&mut self, _display_info: DisplayInfo)
修改显示信息。
显示已有的标签。
修改已有的标签。
impl StructuralPartialEq for Switch
Auto Trait Implementations§
impl Freeze for Switch
impl RefUnwindSafe for Switch
impl Send for Switch
impl Sync for Switch
impl Unpin for Switch
impl UnsafeUnpin for Switch
impl UnwindSafe for Switch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().