Module .druidscroll
Component to handle scroll content
Functions
scroll:scroll_to(vector3[, is_instant]) | Start scroll to target point |
scroll:init(self, index[, skip_cb]) | Scroll to item in scroll by point index |
scroll:set_points(self, points) | Set points of interest. |
scroll:set_inert(self, state) | Enable or disable scroll inert. |
scroll:on_point_move(self, callback) | Set the callback on scrolling to point (if exist) |
scroll:set_border(self, border) | Set the scroll possibly area |
Functions
- scroll:scroll_to(vector3[, is_instant])
-
Start scroll to target point
Parameters:
- vector3 point target point
- is_instant bool instant scroll flag (optional)
Usage:
scroll:scroll_to(vmath.vector3(0, 50, 0))
scroll:scroll_to(vmath.vector3(0), true)
- scroll:init(self, index[, skip_cb])
-
Scroll to item in scroll by point index
Parameters:
- self table Component instance
- index number Point index
- skip_cb boolean If true, skip the point callback (optional)
- scroll:set_points(self, points)
-
Set points of interest.
Scroll will always centered on closer points
Parameters:
- scroll:set_inert(self, state)
-
Enable or disable scroll inert.
If disabled, scroll through points (if exist)
If no points, just simple drag without inertion
Parameters:
- self table Component instance
- state boolean Inert scroll state
- scroll:on_point_move(self, callback)
-
Set the callback on scrolling to point (if exist)
Parameters:
- self table Component instance
- callback function Callback on scroll to point of interest
- scroll:set_border(self, border)
-
Set the scroll possibly area
Parameters:
- self table Component instance
- border vmath.vector3 Size of scrolling area