voxell-tech / bevy_motiongfx

Motion graphics creation tool in Bevy. (Highly inspired by Motion Canvas and Manim)
Apache License 2.0
169 stars 3 forks source link

Sequence builder #46

Closed nixon-voxell closed 6 months ago

nixon-voxell commented 6 months ago

Replace play! macro with SequenceBuilder

let sequence = commands
    .add_motion(
        cube.to_scale(Vec3::splat(0.9))
            .with_ease(circ_ease)
            .animate(1.0),
    )
    .add_motion(
        cube.to_translation_x(cube.transform.translation.x + 1.0)
            .with_ease(circ_ease)
            .animate(1.0),
    )
    .add_motion(
        cube.to_rotation(Quat::from_euler(
            EulerRot::XYZ,
            0.0,
            f32::to_radians(90.0),
            0.0,
        ))
        .with_ease(circ_ease)
        .animate(1.0),
    )
    .all();