pub struct Container {
pub transform: Transform,
pub alpha: f32,
pub visible: bool,
pub blend_mode: BlendMode,
pub clip: Option<MaskShape>,
pub(crate) children: Vec<NodeId>,
pub(crate) parent: Option<NodeId>,
}Expand description
Scene-graph container.
Holds child node IDs and the per-node transform/alpha/visibility/blend
state. parent is None for orphans and for the stage root.
Fields§
§transform: TransformLocal affine transform.
alpha: f32Alpha multiplier in [0.0, 1.0]. Multiplied with parent alpha at render.
visible: boolSkip rendering when false. Children are also skipped.
blend_mode: BlendModeBlend mode used when compositing this node’s output over its target.
clip: Option<MaskShape>Optional mask region (M-MASK.1). When Some, the container’s
rendered subtree is clipped to the shape: pixels outside the
mask have their alpha zeroed before being composited onto the
parent. The renderer routes clipped containers through an
offscreen pass — see crate::render::clip.
children: Vec<NodeId>§parent: Option<NodeId>Implementations§
Source§impl Container
impl Container
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a default container — identity transform, full alpha, visible, normal blend.
Sourcepub fn children(
&self,
) -> impl DoubleEndedIterator<Item = NodeId> + ExactSizeIterator + '_
pub fn children( &self, ) -> impl DoubleEndedIterator<Item = NodeId> + ExactSizeIterator + '_
Iterate child node IDs in insertion order.
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Number of direct children.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl UnwindSafe for Container
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§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>
ReadEndian::read_from_little_endian().