pub struct Switch {Show 15 fields
pub discern_type: String,
pub name: String,
pub appearance: Vec<SwitchData>,
pub switch_image_name: String,
pub enable_hover_click_image: [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 sound_path: String,
}
Expand description
RC的开关资源。
Fields§
§discern_type: String
§name: String
§appearance: Vec<SwitchData>
外观(包括图片纹理和叠加颜色,数量为开启的动画数量*开关状态总数)。
switch_image_name: String
开关使用的图片名称。
enable_hover_click_image: [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]
开关文本资源的原始位置。
sound_path: String
开关点击音效路径。
Trait Implementations§
Source§impl RustConstructorResource for Switch
impl RustConstructorResource for Switch
Source§fn expose_type(&self) -> &str
fn expose_type(&self) -> &str
返回资源类型。
Source§fn reg_render_resource(&self, render_list: &mut Vec<RenderResource>)
fn reg_render_resource(&self, render_list: &mut Vec<RenderResource>)
注册资源。
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more