Class: SparkleMotion::LaunchPad::Widgets::Button

Inherits:
Toggle show all
Defined in:
lib/sparkle_motion/launch_pad/widgets/button.rb

Overview

Class to represent a single stateless button.

Instance Attribute Summary

Attributes inherited from Toggle

#on_press

Attributes inherited from SparkleMotion::LaunchPad::Widget

#down, #height, #off, #on, #value, #width, #x, #y

Instance Method Summary collapse

Methods inherited from Toggle

#render, #update

Methods inherited from SparkleMotion::LaunchPad::Widget

#blank, #max_v, #render, #update

Constructor Details

#initialize(launchpad:, position: nil, x: nil, y: nil, color:, down:, on_press: nil, value: 0) ⇒ Button

Returns a new instance of Button.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sparkle_motion/launch_pad/widgets/button.rb', line 8

def initialize(launchpad:,
               position: nil,
               x: nil,
               y: nil,
               color:,
               down:,
               on_press: nil,
               value: 0)
  super(launchpad: launchpad,
        position:  position,
        x:         x,
        y:         y,
        on:        color,
        off:       color,
        down:      down,
        value:     value,
        on_press:  on_press)
end