Skip to main content

SceneNode

Enum SceneNode 

Source
#[non_exhaustive]
pub enum SceneNode {
Show 21 variants Rect { rect: Rect, brush: Brush, radius: [Px; 4], }, Border { rect: Rect, color: Color, width: Px, radius: [Px; 4], }, Text {
Show 14 fields rect: Rect, text: Arc<str>, color: Color, size: Px, font_family: Option<&'static str>, text_align: TextAlign, font_weight: FontWeight, font_style: FontStyle, text_decoration: TextDecoration, letter_spacing: Px, line_height: Px, extra_style: TextExtraStyle, url: Option<Arc<str>>, font_variation_settings: Option<Arc<str>>,
}, Ellipse { rect: Rect, brush: Brush, }, EllipseBorder { rect: Rect, color: Color, width: Px, }, PushClip { rect: Rect, radius: [Px; 4], op: ClipOp, }, PopClip, PushTransform { transform: Transform, }, PopTransform, Image { rect: Rect, handle: ImageHandle, tint: Color, fit: ImageFit, }, Coverage { rect: Rect, handle: ImageHandle, color: Color, }, Shadow { rect: Rect, radius: [Px; 4], elevation: Px, color: Color, }, BeginLayer { rect: Rect, layer_id: u32, alpha: f32, blur_radius_x: Px, blur_radius_y: Px, rectangle_edge: bool, }, EndLayer { layer_id: u32, }, CompositeShadow { layer_id: u32, blur_px: Px, offset_px: (Px, Px), color: Color, }, Arc { rect: Rect, start_angle: f32, sweep_angle: f32, stroke_width: Px, color: Color, cap: StrokeCap, }, VectorMesh { mesh: Arc<VectorMeshData>, transform: [f32; 6], paint: PaintDesc, clip: Option<u32>, blend: BlendMode, }, VectorOverlay { meshes: Arc<[VectorMeshData]>, }, PushVectorClip { mesh: Arc<VectorMeshData>, op: ClipOp, }, PopVectorClip, Callback { rect: Rect, payload: PaintCallbackPayload, },
}
Expand description

Paint-space scene graph. Rect/Vec2 compounds carry physical pixels (like Compose Offset/Size/Rect); scalar lengths use Px so the dp→px boundary is explicit instead of unitless f32.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Rect

Fields

§rect: Rect
§brush: Brush
§radius: [Px; 4]
§

Border

Fields

§rect: Rect
§color: Color
§width: Px
§radius: [Px; 4]
§

Text

Fields

§rect: Rect
§text: Arc<str>
§color: Color
§size: Px
§font_family: Option<&'static str>
§text_align: TextAlign
§font_weight: FontWeight
§font_style: FontStyle
§text_decoration: TextDecoration
§letter_spacing: Px
§line_height: Px
§extra_style: TextExtraStyle

Rarely-tweaked style properties, bundled for ergonomic Default.

§url: Option<Arc<str>>

URL for clickable link text.

§font_variation_settings: Option<Arc<str>>

OpenType font variation settings (e.g. “wght 700, opsz 24”).

§

Ellipse

Fields

§rect: Rect
§brush: Brush
§

EllipseBorder

Fields

§rect: Rect
§color: Color
§width: Px
§

PushClip

Fields

§rect: Rect
§radius: [Px; 4]
§

PopClip

§

PushTransform

Fields

§transform: Transform
§

PopTransform

§

Image

Fields

§rect: Rect
§tint: Color
§

Coverage

Tinted A8 coverage mask: samples handle (registered with register_coverage_a8) as coverage and composites color with source-over. Lets hosts rasterize geometry once (e.g. cached glyph coverage tiles) and re-composite it per frame with a new color or position without re-uploading. rect positions the tile’s top-left; its size is the registered tile size.

Fields

§rect: Rect
§color: Color
§

Shadow

Shadow behind a rounded rect, typically driven by StateElevation. The elevation field controls offset and alpha.

Fields

§rect: Rect
§radius: [Px; 4]
§elevation: Px
§color: Color
§

BeginLayer

Mark the start of a graphics layer: the contained subtree is rendered into an offscreen texture and then composited back into the parent. alpha is the group-compositing alpha applied at composite time. blur_radius_x / blur_radius_y are the gaussian blur radii in Px applied to the layer before compositing (zero = no blur on that axis). rectangle_edge true = clamp edge pixels (Rectangle). False = transparent out-of-bounds (Unbounded).

Fields

§rect: Rect
§layer_id: u32
§alpha: f32
§blur_radius_x: Px
§blur_radius_y: Px
§rectangle_edge: bool
§

EndLayer

Closes the graphics layer opened by the matching BeginLayer.

Fields

§layer_id: u32
§

CompositeShadow

Draws a blurred drop shadow underneath a previously-rendered layer. Emitted between EndLayer and the layer’s CompositeLayer. The quad samples the layer’s texture with a 3x3 Gaussian blur and an optional vertical offset.

Fields

§layer_id: u32
§blur_px: Px
§offset_px: (Px, Px)
§color: Color
§

Arc

Arc stroke

Fields

§rect: Rect
§start_angle: f32
§sweep_angle: f32
§stroke_width: Px
§color: Color
§

VectorMesh

Pre-tessellated vector mesh (fill or stroke geometry produced by the host, e.g. lyon tessellation). Vertices live in the mesh’s own local space; transform is a 2x3 affine that maps local -> world pixels as [m00, m01, m10, m11, tx, ty] (out = M * local + t; identity is [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]) and is applied in the vertex shader. The current scene PushTransform stack is folded in on top of transform.

Fields

§transform: [f32; 6]
§clip: Option<u32>

Reserved for explicit clip assignment. Clipping is otherwise structural via PushVectorClip/PopVectorClip.

§

VectorOverlay

Screen-space overlays (handles, rubber bands, playhead). Each mesh is positioned in final device pixels and ignores the world PushTransform stack. Emit outside the viewport’s world transform.

Fields

§

PushVectorClip

Start a vector clip: the mesh is rendered into the stencil buffer (increment) and subsequent content is masked to it. Mirrors the rect-based PushClip but for arbitrary tessellated masks. op selects intersection (keep content inside the mask, the common case) or difference (cut the mask out, e.g. ASS \iclip drawings). Difference is exact for a lone mask and for a mask nested inside intersect clips; a normal clip nested inside a difference mask is best-effort (see the renderer docs).

Fields

§

PopVectorClip

End a vector clip opened by PushVectorClip.

§

Callback

Custom GPU paint callback (check egui::PaintCallback).

Fields

§rect: Rect

Trait Implementations§

Source§

impl Clone for SceneNode

Source§

fn clone(&self) -> SceneNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.