pub struct App {
pub rust_constructor_resource: Vec<RustConstructorResourceBox>,
pub tick_interval: f32,
pub current_page: String,
pub timer: Timer,
pub frame_times: Vec<f32>,
pub last_frame_time: Option<f32>,
pub basic_front_resource_list: Vec<String>,
pub render_layer: Vec<([String; 2], [[f32; 2]; 2], bool)>,
pub active_list: Vec<[String; 2]>,
pub render_list: Vec<[String; 2]>,
pub event_list: Vec<Event>,
pub event_map: Vec<[String; 2]>,
}Expand description
程序主体。
Fields§
§rust_constructor_resource: Vec<RustConstructorResourceBox>RC资源。
tick_interval: f32RC资源刷新率。
current_page: String当前页面。
timer: Timer计时器。
frame_times: Vec<f32>帧时间。
last_frame_time: Option<f32>上一帧时间。
basic_front_resource_list: Vec<String>标记哪些资源属于基本前端资源,此列表不应以任何形式进行修改。
render_layer: Vec<([String; 2], [[f32; 2]; 2], bool)>标记渲染物件的层级和位置。
active_list: Vec<[String; 2]>活跃资源列表。
render_list: Vec<[String; 2]>渲染队列。
event_list: Vec<Event>事件列表。
event_map: Vec<[String; 2]>事件映射。
Implementations§
Source§impl App
impl App
pub fn tick_interval(self, tick_interval: f32) -> Self
pub fn current_page(self, current_page: &str) -> Self
Sourcepub fn update_event_list(&mut self)
pub fn update_event_list(&mut self)
更新事件列表。
Sourcepub fn draw_resources(&mut self, ui: &mut Ui, ctx: &Context)
pub fn draw_resources(&mut self, ui: &mut Ui, ctx: &Context)
一次性绘制所有资源,会丢弃所有返回值,不建议使用。
Sourcepub fn draw_resource_by_index(
&mut self,
ui: &mut Ui,
ctx: &Context,
index: usize,
) -> Result<(), RustConstructorError>
pub fn draw_resource_by_index( &mut self, ui: &mut Ui, ctx: &Context, index: usize, ) -> Result<(), RustConstructorError>
根据索引值绘制资源,建议使用for循环搭配。
Sourcepub fn active_list_info(
&self,
display_complex_info: bool,
format: bool,
) -> String
pub fn active_list_info( &self, display_complex_info: bool, format: bool, ) -> String
打印资源活跃情况。
Sourcepub fn render_layer_info(&self) -> String
pub fn render_layer_info(&self) -> String
打印渲染层级列表。
Sourcepub fn render_list_info(&self) -> String
pub fn render_list_info(&self) -> String
打印渲染队列。
Sourcepub fn update_render_list(&mut self)
pub fn update_render_list(&mut self)
更新渲染队列。
Sourcepub fn request_jump_render_list(
&mut self,
requester: [&str; 2],
) -> Result<(), RustConstructorError>
pub fn request_jump_render_list( &mut self, requester: [&str; 2], ) -> Result<(), RustConstructorError>
请求在渲染队列中插队。
Sourcepub fn update_render_layer(&mut self)
pub fn update_render_layer(&mut self)
根据活跃资源更新渲染层级列表。
Sourcepub fn display_render_layer(
&self,
ui: &mut Ui,
render_config: &RenderConfig,
ignore_render_config: &RenderConfig,
)
pub fn display_render_layer( &self, ui: &mut Ui, render_config: &RenderConfig, ignore_render_config: &RenderConfig, )
绘制渲染层。
Sourcepub fn get_render_layer_resource(
&self,
name: &str,
discern_type: &str,
) -> Option<usize>
pub fn get_render_layer_resource( &self, name: &str, discern_type: &str, ) -> Option<usize>
通过名称和类型在渲染列表中查找资源。
Sourcepub fn add_active_resource(
&mut self,
name: &str,
discern_type: &str,
) -> Result<(), RustConstructorError>
pub fn add_active_resource( &mut self, name: &str, discern_type: &str, ) -> Result<(), RustConstructorError>
标记活跃资源。
Sourcepub fn add_resource<T: RustConstructorResource + 'static>(
&mut self,
name: &str,
resource: T,
) -> Result<(), RustConstructorError>
pub fn add_resource<T: RustConstructorResource + 'static>( &mut self, name: &str, resource: T, ) -> Result<(), RustConstructorError>
添加资源。
Sourcepub fn drop_resource(
&mut self,
name: &str,
discern_type: &str,
) -> Result<(), RustConstructorError>
pub fn drop_resource( &mut self, name: &str, discern_type: &str, ) -> Result<(), RustConstructorError>
移除资源。此方法非常危险!务必确保资源一定不再使用后删除。
Sourcepub fn replace_resource<T>(
&mut self,
name: &str,
resource: T,
) -> Result<(), RustConstructorError>where
T: RustConstructorResource + 'static,
pub fn replace_resource<T>(
&mut self,
name: &str,
resource: T,
) -> Result<(), RustConstructorError>where
T: RustConstructorResource + 'static,
从列表中替换资源。
Sourcepub fn get_resource<T>(
&self,
name: &str,
discern_type: &str,
) -> Result<&T, RustConstructorError>where
T: RustConstructorResource + 'static,
pub fn get_resource<T>(
&self,
name: &str,
discern_type: &str,
) -> Result<&T, RustConstructorError>where
T: RustConstructorResource + 'static,
从列表中获取不可变资源。
Sourcepub fn get_resource_mut<T>(
&mut self,
name: &str,
discern_type: &str,
) -> Result<&mut T, RustConstructorError>where
T: RustConstructorResource + 'static,
pub fn get_resource_mut<T>(
&mut self,
name: &str,
discern_type: &str,
) -> Result<&mut T, RustConstructorError>where
T: RustConstructorResource + 'static,
从列表中获取可变资源。
Sourcepub fn check_resource_exists(
&self,
name: &str,
discern_type: &str,
) -> Option<usize>
pub fn check_resource_exists( &self, name: &str, discern_type: &str, ) -> Option<usize>
检查是否存在特定资源。
Sourcepub fn quick_place<T: RustConstructorResource + 'static>(
&mut self,
name: &str,
resource: T,
ui: &mut Ui,
ctx: &Context,
need_place_holder: NeedPlaceholder,
) -> Result<(), RustConstructorError>
pub fn quick_place<T: RustConstructorResource + 'static>( &mut self, name: &str, resource: T, ui: &mut Ui, ctx: &Context, need_place_holder: NeedPlaceholder, ) -> Result<(), RustConstructorError>
快速放置。
Sourcepub fn use_resource(
&mut self,
name: &str,
discern_type: &str,
ui: &mut Ui,
ctx: &Context,
need_place_holder: NeedPlaceholder,
) -> Result<(), RustConstructorError>
pub fn use_resource( &mut self, name: &str, discern_type: &str, ui: &mut Ui, ctx: &Context, need_place_holder: NeedPlaceholder, ) -> Result<(), RustConstructorError>
调用资源。
Sourcepub fn switch_page(&mut self, name: &str) -> Result<(), RustConstructorError>
pub fn switch_page(&mut self, name: &str) -> Result<(), RustConstructorError>
切换页面。
Sourcepub fn get_font(
&mut self,
name: &str,
) -> Result<FontDefinitions, RustConstructorError>
pub fn get_font( &mut self, name: &str, ) -> Result<FontDefinitions, RustConstructorError>
输出字体资源。
Sourcepub fn register_all_fonts(&mut self, ctx: &Context)
pub fn register_all_fonts(&mut self, ctx: &Context)
将所有已添加到RC的字体资源添加到egui中。
Sourcepub fn position_size_processor(
&self,
position_size_config: PositionSizeConfig,
ctx: &Context,
) -> [[f32; 2]; 2]
pub fn position_size_processor( &self, position_size_config: PositionSizeConfig, ctx: &Context, ) -> [[f32; 2]; 2]
处理最基本的位置计算。
Sourcepub fn check_updated(
&mut self,
name: &str,
) -> Result<bool, RustConstructorError>
pub fn check_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>
检查页面是否已完成首次加载。
Sourcepub fn check_enter_updated(
&mut self,
name: &str,
) -> Result<bool, RustConstructorError>
pub fn check_enter_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>
检查页面是否已完成加载。
Sourcepub fn new_page_update(
&mut self,
name: &str,
) -> Result<(), RustConstructorError>
pub fn new_page_update( &mut self, name: &str, ) -> Result<(), RustConstructorError>
进入新页面时的更新。
Sourcepub fn update_frame_stats(&mut self)
pub fn update_frame_stats(&mut self)
更新帧数。
Sourcepub fn current_fps(&self) -> f32
pub fn current_fps(&self) -> f32
更新帧数显示。
Sourcepub fn reset_split_time(
&mut self,
name: &str,
) -> Result<(), RustConstructorError>
pub fn reset_split_time( &mut self, name: &str, ) -> Result<(), RustConstructorError>
重置分段时间。
Sourcepub fn get_split_time(
&mut self,
name: &str,
) -> Result<[f32; 2], RustConstructorError>
pub fn get_split_time( &mut self, name: &str, ) -> Result<[f32; 2], RustConstructorError>
输出分段时间。
Sourcepub fn update_timer(&mut self)
pub fn update_timer(&mut self)
更新计时器。
Sourcepub fn modify_variable<T: Debug + 'static>(
&mut self,
name: &str,
value: Option<T>,
) -> Result<(), RustConstructorError>
pub fn modify_variable<T: Debug + 'static>( &mut self, name: &str, value: Option<T>, ) -> Result<(), RustConstructorError>
修改变量资源。
Sourcepub fn get_variable<T: Debug + Clone + 'static>(
&mut self,
name: &str,
) -> Result<Option<T>, RustConstructorError>
pub fn get_variable<T: Debug + Clone + 'static>( &mut self, name: &str, ) -> Result<Option<T>, RustConstructorError>
取出变量。
Sourcepub fn get_image_texture(
&mut self,
name: &str,
) -> Result<Option<DebugTextureHandle>, RustConstructorError>
pub fn get_image_texture( &mut self, name: &str, ) -> Result<Option<DebugTextureHandle>, RustConstructorError>
输出图片纹理。
Sourcepub fn reset_image_texture(
&mut self,
name: &str,
path: &str,
flip: [bool; 2],
ctx: &Context,
) -> Result<(), RustConstructorError>
pub fn reset_image_texture( &mut self, name: &str, path: &str, flip: [bool; 2], ctx: &Context, ) -> Result<(), RustConstructorError>
重置图片纹理。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl Unpin for App
impl !UnwindSafe for App
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> 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> 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().