Skip to main content

NodeTransition

Struct NodeTransition 

Source
pub struct NodeTransition { /* private fields */ }
Expand description

Paint-only opacity and 2D transform transition animated per frame without re-running layout.

Implementations§

Source§

impl NodeTransition

Standard transition presets and sampling helpers for NodeTransition.

Source

pub fn for_node(node: NodeId) -> Self

Creates a fluent base transition targeting node (200ms EaseOutCubic, identity transform/opacity).

§Arguments
  • NodeId - Target scene node handle.
§Returns
  • Self - Configurable NodeTransition ready for chained setters.
Source

pub fn with_delay(self, delay_secs: f32) -> Self

Sets an initial hold delay in seconds before interpolation begins.

§Arguments
  • Self - Source transition.
  • f32 - Delay duration in seconds (clamped to >= 0.0).
§Returns
  • Self - Updated transition with start delay.
Source

pub fn with_duration(self, duration_secs: f32) -> Self

Sets transition duration in seconds.

§Arguments
  • Self - Source transition.
  • f32 - Duration in seconds (minimum 16ms).
§Returns
  • Self - Updated transition.
Source

pub fn with_easing(self, easing: Easing) -> Self

Sets the interpolation easing curve.

§Arguments
  • Self - Source transition.
  • Easing - Easing curve variant.
§Returns
  • Self - Updated transition.
Source

pub fn with_opacity(self, from: f32, to: f32) -> Self

Configures start and end opacity values in [0.0, 1.0].

§Arguments
  • Self - Source transition.
  • f32 - Starting opacity.
  • f32 - Ending opacity.
§Returns
  • Self - Updated transition.
Source

pub fn with_offset(self, from: Point, to: Point) -> Self

Configures start and end 2D translation offsets in logical pixels.

§Arguments
  • Self - Source transition.
  • Point - Starting (tx, ty) offset.
  • Point - Ending (tx, ty) offset.
§Returns
  • Self - Updated transition.
Source

pub fn with_scale(self, from: f32, to: f32) -> Self

Configures uniform start and end scale multipliers.

§Arguments
  • Self - Source transition.
  • f32 - Starting scale factor.
  • f32 - Ending scale factor.
§Returns
  • Self - Updated transition.
Source

pub fn with_hide_on_complete(self, hide: bool) -> Self

Configures whether the node switches to Display::None when the transition completes.

§Arguments
  • Self - Source transition.
  • bool - Hide-on-complete flag.
§Returns
  • Self - Updated transition.
Source

pub fn route_enter(node: NodeId) -> Self

Creates a standard route-switch entrance transition (240ms EaseOutQuint, fade + 14px upward glide).

§Arguments
  • NodeId - Target page container node.
§Returns
  • Self - Route entrance transition.
Source

pub fn route_slide_enter(node: NodeId, start_tx: f32) -> Self

Creates a directional horizontal page-slide entrance transition (260ms EaseOutQuint, opaque crisp slide).

§Arguments
  • NodeId - Incoming page container node.
  • f32 - Starting horizontal translation offset in logical pixels (+px enters from right, -px enters from left).
§Returns
  • Self - Directional horizontal route entrance transition.
Source

pub fn route_slide_exit(node: NodeId, end_tx: f32) -> Self

Creates a directional horizontal page-slide exit transition (220ms EaseOutQuint) hiding the node on completion.

§Arguments
  • NodeId - Outgoing page container node.
  • f32 - Ending horizontal translation offset in logical pixels (-px exits left, +px exits right).
§Returns
  • Self - Directional horizontal route exit transition.
Source

pub fn fade( node: NodeId, from: f32, to: f32, duration: f32, hide_on_complete: bool, ) -> Self

Creates a pure opacity fade transition with optional Display::None on completion.

§Arguments
  • NodeId - Target node handle.
  • f32 - Starting opacity.
  • f32 - Ending opacity.
  • f32 - Duration in seconds.
  • bool - Whether to hide the node when the transition finishes.
§Returns
  • Self - Fade transition.
Source

pub fn slide_fade( node: NodeId, from_offset: Point, to_offset: Point, from_opacity: f32, to_opacity: f32, duration: f32, hide_on_complete: bool, ) -> Self

Creates a slide-and-fade transition for drawers, sheets, popovers, dropdowns, and toasts.

§Arguments
  • NodeId - Target node handle.
  • Point - Starting (tx, ty) offset in logical pixels.
  • Point - Ending (tx, ty) offset in logical pixels.
  • f32 - Starting opacity.
  • f32 - Ending opacity.
  • f32 - Duration in seconds.
  • bool - Whether to hide the node upon completion.
§Returns
  • Self - Slide + fade transition.
Source

pub fn modal_enter(node: NodeId) -> Self

Creates a subtle scale-and-rise modal dialog entrance transition (200ms EaseOutCubic).

§Arguments
  • NodeId - Target dialog panel node.
§Returns
  • Self - Modal dialog entrance transition.
Source

pub fn modal_exit(node: NodeId) -> Self

Creates a modal dialog exit transition (180ms EaseOutCubic).

§Arguments
  • NodeId - Target dialog panel node.
§Returns
  • Self - Modal dialog exit transition.
Source

pub fn sample(&self) -> (f32, Transform2D)

Evaluates interpolated (opacity, Transform2D) at the current elapsed timestamp.

§Arguments
  • &Self - Transition reference.
§Returns
  • (f32, Transform2D) - Current interpolated opacity and 2D transform.
Source

pub fn is_complete(&self) -> bool

Returns true when the transition has reached or exceeded its total delay + duration.

§Arguments
  • &Self - Transition reference.
§Returns
  • bool - Whether this transition is finished.
Source§

impl NodeTransition

Source

pub fn get_node(&self) -> NodeId

Source

pub fn get_mut_node(&mut self) -> &mut NodeId

Source

pub fn set_node(&mut self, val: NodeId) -> &mut Self

Source

pub fn get_elapsed(&self) -> f32

Source

pub fn get_mut_elapsed(&mut self) -> &mut f32

Source

pub fn set_elapsed(&mut self, val: f32) -> &mut Self

Source

pub fn get_delay(&self) -> f32

Source

pub fn get_mut_delay(&mut self) -> &mut f32

Source

pub fn set_delay(&mut self, val: f32) -> &mut Self

Source

pub fn get_duration(&self) -> f32

Source

pub fn get_mut_duration(&mut self) -> &mut f32

Source

pub fn set_duration(&mut self, val: f32) -> &mut Self

Source

pub fn get_easing(&self) -> Easing

Source

pub fn get_mut_easing(&mut self) -> &mut Easing

Source

pub fn set_easing(&mut self, val: Easing) -> &mut Self

Source

pub fn get_from_opacity(&self) -> f32

Source

pub fn get_mut_from_opacity(&mut self) -> &mut f32

Source

pub fn set_from_opacity(&mut self, val: f32) -> &mut Self

Source

pub fn get_to_opacity(&self) -> f32

Source

pub fn get_mut_to_opacity(&mut self) -> &mut f32

Source

pub fn set_to_opacity(&mut self, val: f32) -> &mut Self

Source

pub fn get_from_tx(&self) -> f32

Source

pub fn get_mut_from_tx(&mut self) -> &mut f32

Source

pub fn set_from_tx(&mut self, val: f32) -> &mut Self

Source

pub fn get_to_tx(&self) -> f32

Source

pub fn get_mut_to_tx(&mut self) -> &mut f32

Source

pub fn set_to_tx(&mut self, val: f32) -> &mut Self

Source

pub fn get_from_ty(&self) -> f32

Source

pub fn get_mut_from_ty(&mut self) -> &mut f32

Source

pub fn set_from_ty(&mut self, val: f32) -> &mut Self

Source

pub fn get_to_ty(&self) -> f32

Source

pub fn get_mut_to_ty(&mut self) -> &mut f32

Source

pub fn set_to_ty(&mut self, val: f32) -> &mut Self

Source

pub fn get_from_scale(&self) -> f32

Source

pub fn get_mut_from_scale(&mut self) -> &mut f32

Source

pub fn set_from_scale(&mut self, val: f32) -> &mut Self

Source

pub fn get_to_scale(&self) -> f32

Source

pub fn get_mut_to_scale(&mut self) -> &mut f32

Source

pub fn set_to_scale(&mut self, val: f32) -> &mut Self

Source

pub fn get_hide_on_complete(&self) -> bool

Source

pub fn get_mut_hide_on_complete(&mut self) -> &mut bool

Source

pub fn set_hide_on_complete(&mut self, val: bool) -> &mut Self

Trait Implementations§

Source§

impl Clone for NodeTransition

Source§

fn clone(&self) -> Self

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 Copy for NodeTransition

Source§

impl Debug for NodeTransition

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for NodeTransition

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NodeTransition

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.