.. index:: pair: class; EE::UI::UIScrollController .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller: class EE::UI::UIScrollController ================================ .. toctree:: :hidden: struct_EE_UI_UIScrollController_SmoothTween.rst Overview ~~~~~~~~ Allocation-free, frame-rate-independent scroll motion state. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class UIScrollController { public: // structs struct :ref:`SmoothTween`; // methods void :ref:`setPosition`(const :ref:`Vector2f`& position, const :ref:`Vector2f`& maxPosition); bool :ref:`scrollBy`(const :ref:`Vector2f`& delta, const :ref:`Vector2f`& currentPosition, const :ref:`Vector2f`& maxPosition, bool smooth, :ref:`Float` durationScale = 1.f); void :ref:`beginDrag`(const :ref:`Vector2f`& position, const :ref:`Vector2f`& maxPosition); bool :ref:`dragBy`(const :ref:`Vector2f`& delta, const :ref:`Time`& elapsed, const :ref:`Vector2f`& maxPosition); void :ref:`endDrag`(); bool :ref:`update`(const :ref:`Time`& elapsed, const :ref:`Vector2f`& maxPosition); void :ref:`stop`(); bool :target:`isActive`() const; bool :target:`isDragging`() const; const :ref:`Vector2f`& :target:`getPosition`() const; const :ref:`Vector2f`& :target:`getTarget`() const; const :ref:`Vector2f`& :target:`getVelocity`() const; :ref:`Time` :target:`getWheelScrollDuration`() const; void :ref:`setWheelScrollDuration`(const :ref:`Time`& duration); :ref:`Vector2f` :target:`getDragDeceleration`() const; void :target:`setDragDeceleration`(const :ref:`Vector2f`& deceleration); }; .. _details-class_e_e_1_1_u_i_1_1_u_i_scroll_controller: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Allocation-free, frame-rate-independent scroll motion state. The controller operates in pixel coordinates but deliberately does not own a widget. This lets virtualized views, translated child views, and text editors share the same motion without forcing them into a common rendering hierarchy. Methods ------- .. index:: pair: function; setPosition .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1aef1fc0ac8d738495c84d95f458f78381: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setPosition(const :ref:`Vector2f`& position, const :ref:`Vector2f`& maxPosition) Synchronizes the controller with an externally changed scroll position and stops motion. .. index:: pair: function; scrollBy .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a45263d534623251b68de9023794bcf21: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool scrollBy(const :ref:`Vector2f`& delta, const :ref:`Vector2f`& currentPosition, const :ref:`Vector2f`& maxPosition, bool smooth, :ref:`Float` durationScale = 1.f) Adds a wheel displacement. Returns false when the target cannot move in either axis. .. index:: pair: function; beginDrag .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a328c4e21e5239396714eadc04289abb2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void beginDrag(const :ref:`Vector2f`& position, const :ref:`Vector2f`& maxPosition) Starts direct manipulation at the current scroll position. .. index:: pair: function; dragBy .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a6ce77ba97add40289fe8a32dc3fde031: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool dragBy(const :ref:`Vector2f`& delta, const :ref:`Time`& elapsed, const :ref:`Vector2f`& maxPosition) Applies a drag displacement and records a filtered release velocity. .. index:: pair: function; endDrag .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a3409c9e309e056d62c057e3db31c2857: .. ref-code-block:: cpp :class: doxyrest-title-code-block void endDrag() Transitions a direct manipulation into inertial motion. .. index:: pair: function; update .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a06dc17927f629f3a05769ead696df4cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool update(const :ref:`Time`& elapsed, const :ref:`Vector2f`& maxPosition) Advances smooth or inertial motion. Returns true when the position changed. .. index:: pair: function; stop .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1a0428041eadbe1817a790908e5a674acb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void stop() Stops all pending motion at the current controller position. .. index:: pair: function; setWheelScrollDuration .. _doxid-class_e_e_1_1_u_i_1_1_u_i_scroll_controller_1af66c683da3cbb2301bfb6188c4710579: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setWheelScrollDuration(const :ref:`Time`& duration) Sets the duration used to visually interpolate one wheel displacement.