# Module `Slider`

Druid slider component

## Functions

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

## Fields

on_change_value | On change value callback(self, value)
node | Slider pin node
start_pos | Start pin node position
pos | Current pin node position
target_pos | Targer pin node position
end_pos | End pin node position
dist | Length between start and end position
is_drag | Current drag state
value | Current slider value

## Functions

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

  ### Parameters:

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

  ### Parameters:

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

  ### Parameters:

  - self Slider
  - steps number[] Array of steps

  ### Usage:

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

## Fields

on_change_value
  On change value callback(self, value)
  - on_change_value druid_event
node
  Slider pin node
  - node node
start_pos
  Start pin node position
  - start_pos vector3
pos
  Current pin node position
  - pos vector3
target_pos
  Targer pin node position
  - target_pos vector3
end_pos
  End pin node position
  - end_pos vector3
dist
  Length between start and end position
  - dist number
is_drag
  Current drag state
  - is_drag bool
value
  Current slider value
  - value number

generated by LDoc 1.4.6 Last updated 2022-02-12 17:16:44