AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Utility object that helps with touchscreen scroll events. More...
Utility object that helps with touchscreen scroll events.
To use this class, you have to pass APointerPressedEvent APointerReleasedEvent to handlePointerPressed and handlePointerReleased methods accordingly. To receive scroll value, use handlePointerMove method.
Public Member Functions | |
void | handlePointerPressed (const APointerPressedEvent &e) |
Handles pointer pressed events. | |
void | handlePointerReleased (const APointerReleasedEvent &e) |
Handles pointer released events. | |
glm::ivec2 | handlePointerMove (glm::vec2 pos) |
Handles pointer move events. More... | |
glm::ivec2 | origin () const noexcept |
AOptional< glm::ivec2 > | gatherKineticScrollValue () |
Static Public Member Functions | |
static float | deceleration () |
Static Public Attributes | |
static constexpr float | BASE_DECELERATION = 1600.f |
static constexpr float | INITIAL_ACCELERATION_COEFFICIENT = 60.f |
Initial acceleration after pointer released is defined by direction of pointer moving and this coefficient. | |
static constexpr AMetric | THRESHOLD = 8_dp |
Distance that pointer have to pass in order to treat pointer move events as scroll events. | |
AOptional< glm::ivec2 > ATouchScroller::gatherKineticScrollValue | ( | ) |
This method should be called every render frame in order to make continuous kinetic scroll.
glm::ivec2 ATouchScroller::handlePointerMove | ( | glm::vec2 | pos | ) |
Handles pointer move events.
pos | position of the event in relation to view that used ATouchScroller. |
#include <AUI/Util/ATouchScroller.h>