Expand description
Momentum scroll view for ROSACE.
§Quick start
use rosace_scroll::{ScrollView, ScrollDirection, ScrollPhysics};
let mut sv = ScrollView::new(400.0, 600.0)
.content_size(400.0, 2000.0)
.direction(ScrollDirection::Vertical)
.physics(ScrollPhysics::Momentum { friction: 0.92 });
// On scroll input:
sv.on_scroll(0.0, 15.0);
// Each frame:
sv.tick(0.016);
// Translate content by the returned offset before drawing:
let [_ox, _oy] = sv.scroll_offset();Re-exports§
pub use controller::ScrollController;pub use physics::clamp_offset;pub use physics::snap_to_page;pub use physics::MomentumState;pub use physics::ScrollDirection;pub use physics::ScrollPhysics;pub use physics::ScrollStyle;pub use scrollbar::render_scrollbar;pub use scrollbar::ScrollbarMetrics;pub use scroll_view::ScrollView;