Skip to content

ui::ScalarTransition

Header: winui/ui/Animation.hpp.

Animates every change to an element's opacity or rotation (Element::set_opacity_transition(), Element::set_rotation_transition()) over duration along the cubic Bézier (0.8,0)-(0.2,1), from wherever the property is drawn at that moment.

Example:

auto element = std::make_unique<ui::RectangleControl>();
element->set_opacity_transition(ui::ScalarTransition{.duration = 200ms});
element->set_opacity(0.0f); // fades out over 200 ms instead of vanishing

Field Type Default
duration Duration {300.0} Length of each transition.