# Module `druid.slider`

Druid slider component

## Functions

init(node, end_pos[, callback]) | Component init function
set(value[, is_silent]) | Set value for slider
set_steps(steps) | Set slider steps.

## Tables

Events | Component events
Fields | Component fields

## Functions

init(node, end_pos[, callback])
  Component init function

  ### Parameters:

  - node node Gui pin node
  - end_pos vector3 The end position of slider
  - callback function On slider change callback (optional)
set(value[, is_silent])
  Set value for slider

  ### Parameters:

  - value number Value from 0 to 1
  - is_silent bool Don't trigger event if true (optional)
set_steps(steps)
  Set slider steps. Pin node will apply closest step position

  ### Parameters:

  - steps number[] Array of steps

  ### Usage:

      slider:set_steps({0, 0.2, 0.6, 1})

## Tables

Events
  Component events

  ### Fields:

  - on_change_value druid_event On change value callback
Fields
  Component fields

  ### Fields:

  - node node Slider pin node
  - start_pos vector3 Start pin node position
  - pos vector3 Current pin node position
  - target_pos vector3 Targer pin node position
  - end_pos vector3 End pin node position
  - dist number Length between start and end position
  - is_drag bool Current drag state
  - value number Current slider value

generated by LDoc 1.4.6 Last updated 2020-06-14 20:13:02