Module druid.scroll

Component to handle scroll content

Functions

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


Functions

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

Parameters:

  • self table Component instance
  • border vmath.vector3 Size of scrolling area
generated by LDoc 1.4.6 Last updated 2020-02-07 01:09:38