pub struct Scene {
pub layers: Vec<Layer>,
}Expand description
Fields§
§layers: Vec<Layer>Layers in back-to-front submission order.
Implementations§
Source§impl Scene
Provides the operations defined for Scene.
impl Scene
Provides the operations defined for Scene.
Sourcepub fn push_layer(&mut self, layer: Layer)
pub fn push_layer(&mut self, layer: Layer)
Sourcepub fn push_base_layer(&mut self, clip: ClipStackSnapshot)
pub fn push_base_layer(&mut self, clip: ClipStackSnapshot)
Appends an empty base layer using clip.
§Examples
use ailloli_ui_runtime::scene::{ClipStackSnapshot, LayerKind, Scene};
let mut scene = Scene::default();
scene.push_base_layer(ClipStackSnapshot::empty());
assert_eq!(scene.layers[0].kind, LayerKind::Base);Sourcepub fn push_overlay_layer(&mut self, clip: ClipStackSnapshot)
pub fn push_overlay_layer(&mut self, clip: ClipStackSnapshot)
Appends an empty overlay layer using clip.
§Examples
use ailloli_ui_runtime::scene::{ClipStackSnapshot, LayerKind, Scene};
let mut scene = Scene::default();
scene.push_overlay_layer(ClipStackSnapshot::empty());
assert_eq!(scene.layers[0].kind, LayerKind::Overlay);Sourcepub fn from_base_and_overlay(
base_clip: Option<ClipShape>,
base_cmds: Vec<DrawCmd>,
overlay_clip: Option<ClipShape>,
overlay_cmds: Vec<DrawCmd>,
) -> Self
pub fn from_base_and_overlay( base_clip: Option<ClipShape>, base_cmds: Vec<DrawCmd>, overlay_clip: Option<ClipShape>, overlay_cmds: Vec<DrawCmd>, ) -> Self
Builds exactly two layers: base first and overlay second.
Command vectors are moved without cloning. None clips create empty
clip snapshots, and both root flags are false.
§Examples
use ailloli_ui_runtime::scene::{LayerKind, Scene};
let scene = Scene::from_base_and_overlay(None, vec![], None, vec![]);
assert_eq!(scene.layers.len(), 2);
assert_eq!((scene.layers[0].kind, scene.layers[1].kind), (LayerKind::Base, LayerKind::Overlay));Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scene
impl !RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl !UnwindSafe for Scene
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<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.