Module druid.scroll

Component to handle scroll content

Functions

init(self, index[, skip_cb]) Scroll to item in scroll by point index
on_point_move(self, callback) Set the callback on scrolling to point (if exist)
scroll_to(vector3[, is_instant]) Start scroll to target point
set_border(self, border) Set the scroll possibly area
set_inert(self, state) Enable or disable scroll inert.
set_points(self, points) Set points of interest.


Functions

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)
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_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)
set_border(self, border)
Set the scroll possibly area

Parameters:

  • self table Component instance
  • border vmath.vector3 Size of scrolling area
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
set_points(self, points)
Set points of interest. Scroll will always centered on closer points

Parameters:

  • self table Component instance
  • points table Array of vector3 points
generated by LDoc 1.4.6 Last updated 2020-02-23 13:01:03