pub struct RenderPlugin { /* private fields */ }Expand description
渲染插件
将渲染系统集成到 AnvilKit ECS 应用中的插件。
§示例
use anvilkit_render::prelude::*;
use anvilkit_ecs::prelude::*;
// 创建应用并添加渲染插件
let mut app = App::new();
app.add_plugins(RenderPlugin::default())
.run();Implementations§
Source§impl RenderPlugin
impl RenderPlugin
Sourcepub fn with_window_config(self, config: WindowConfig) -> Self
pub fn with_window_config(self, config: WindowConfig) -> Self
设置窗口配置
§示例
use anvilkit_render::prelude::*;
let config = WindowConfig::new()
.with_title("我的游戏")
.with_size(1920, 1080);
let plugin = RenderPlugin::new().with_window_config(config);Sourcepub fn window_config(&self) -> &WindowConfig
pub fn window_config(&self) -> &WindowConfig
获取窗口配置
§示例
use anvilkit_render::plugin::RenderPlugin;
let plugin = RenderPlugin::new();
let config = plugin.window_config();
assert_eq!(config.title, "AnvilKit Application");Trait Implementations§
Source§impl Clone for RenderPlugin
impl Clone for RenderPlugin
Source§fn clone(&self) -> RenderPlugin
fn clone(&self) -> RenderPlugin
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RenderPlugin
impl Debug for RenderPlugin
Source§impl Default for RenderPlugin
impl Default for RenderPlugin
Auto Trait Implementations§
impl Freeze for RenderPlugin
impl RefUnwindSafe for RenderPlugin
impl Send for RenderPlugin
impl Sync for RenderPlugin
impl Unpin for RenderPlugin
impl UnsafeUnpin for RenderPlugin
impl UnwindSafe for RenderPlugin
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<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self using data from the given World.