pub struct Switch {Show 16 fields
pub discern_type: String,
pub name: String,
pub appearance: Vec<SwitchAppearance>,
pub fill_resource_name: String,
pub fill_resource_type: String,
pub enable_hover_click_fill_resource: [bool; 2],
pub state: u32,
pub click_method: Vec<SwitchClickAction>,
pub last_time_hovered: bool,
pub last_time_clicked: bool,
pub last_time_clicked_index: usize,
pub animation_count: u32,
pub hint_text_name: String,
pub text_name: String,
pub text_origin_position: [f32; 2],
pub switched: bool,
}Expand description
RC的开关资源。
Fields§
§discern_type: String§name: String§appearance: Vec<SwitchAppearance>外观(包括各类资源配置项,数量为开启的内容数量*开关状态总数)。
fill_resource_name: String开关使用的填充资源名称。
fill_resource_type: String开关使用的填充资源类型。
enable_hover_click_fill_resource: [bool; 2]是否启用鼠标悬浮和点击时的显示内容。
state: u32开关当前状态。
click_method: Vec<SwitchClickAction>可以用于点击开关的方法(包含点击方式和是否改变开关状态两个参数)。
last_time_hovered: bool上一次渲染是否有鼠标悬浮。
last_time_clicked: bool上一次渲染是否被鼠标点击。
last_time_clicked_index: usize上一次点击对应的点击方法的索引。
animation_count: u32动画总数。
hint_text_name: String提示文本资源名。
text_name: String开关上的文本资源名称(不需要可留空)。
text_origin_position: [f32; 2]开关文本资源的原始位置。
switched: bool是否切换了开关状态。
Implementations§
Source§impl Switch
impl Switch
pub fn name(self, name: &str) -> Self
pub fn appearance(self, appearance: Vec<SwitchAppearance>) -> Self
pub fn enable_hover_click_fill_resource( self, enable_hover_fill_resource: bool, enable_click_fill_resource: bool, ) -> Self
pub fn click_method(self, click_method: Vec<SwitchClickAction>) -> Self
Trait Implementations§
Source§impl RustConstructorResource for Switch
impl RustConstructorResource for Switch
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 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().