pub struct DoubleAxisScrollManager { /* private fields */ }Expand description
Independent scroll algorithms for horizontal ([0]) and vertical ([1]) axes.
Implementations§
Source§impl DoubleAxisScrollManager
impl DoubleAxisScrollManager
Sourcepub fn new(scroll: [ScrollAlgorithm; 2]) -> Self
pub fn new(scroll: [ScrollAlgorithm; 2]) -> Self
Creates a manager from per-axis algorithms.
Index 0 is the horizontal axis; index 1 is the vertical axis.
Sourcepub fn direct_set_position(&mut self, position: Vector2)
pub fn direct_set_position(&mut self, position: Vector2)
Sets scroll position on both axes and clears momentum velocity.
Sourcepub fn update(&mut self, d_scroll_x: f32, d_scroll_y: f32, dt: f32)
pub fn update(&mut self, d_scroll_x: f32, d_scroll_y: f32, dt: f32)
Applies per-axis scroll deltas for one frame.
Sourcepub fn get_position(&self) -> Vector2
pub fn get_position(&self) -> Vector2
Returns the current scroll offset as a Vector2.
Auto Trait Implementations§
impl Freeze for DoubleAxisScrollManager
impl RefUnwindSafe for DoubleAxisScrollManager
impl Send for DoubleAxisScrollManager
impl Sync for DoubleAxisScrollManager
impl Unpin for DoubleAxisScrollManager
impl UnsafeUnpin for DoubleAxisScrollManager
impl UnwindSafe for DoubleAxisScrollManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more