Skip to main content

step_opacity_transitions

Function step_opacity_transitions 

Source
pub fn step_opacity_transitions(
    commands: Commands<'_, '_>,
    tick: Res<'_, Tick>,
    anim: Res<'_, AnimationsActive>,
    q: Query<'_, '_, (Entity, &OpacityTransition, &mut Opacity, Option<&Visible>)>,
)
Expand description

Sample every active OpacityTransition and write the result into the entity’s Opacity. When the transition is done, snap to the final value and despawn the transition component.

Hidden entities (Visible(false)) tick no animations (CSS: a display: none subtree has no transitions): the tween completes instantly - snap to the target value, drop the component, no self-scheduled frame.