       @button.backgroundImage = @bg
     else
       @button.isPressed = true
-      @button.backgroundImage = @bgPressed+      @button.backgroundImage = @bgPressed
+     
+  onTouchStart: =>
+    @button.backgroundImage = @bgPressed
+  
+  onTouchEnd: =>
+    @options.onClick()
+    @button.backgroundImage = @bg if !@button.isPressed
+     
+  setEnabled: (enabled) =>
+    if enabled
+      @button.addEventListener "touchstart", @onTouchStart
+      @button.addEventListener "touchend", @onTouchEnd
+      if @label?
+        @label.setOpacity(1)
+    else
+      @button.removeEventListener "touchstart", @onTouchStart
+      @button.removeEventListener "touchend", @onTouchEnd
+      if @label?
+        @label.setOpacity(0.4)

      })
      @button.add(@label)

    @button.addEventListener("touchstart", () => @button.backgroundImage = @bgPressed)
    @button.addEventListener("touchend", () => 
      settings.onClick()
      @button.backgroundImage = @bg if !@button.isPressed
    )
    @button
    
    
  setTitle: (title) =>
    @label.text = title

      })
      @button.add(@label)

    @setEnabled(settings.enabled)
    
    @button

  createButton: (settings) =>
