     point.y -= offsetY
     @buttonGrid.clicked(point)
 
-  showSettings : () =>
+  showSettings : () ->
     @pushView(new SettingsView(this))
 
-  buttonPressed: (text) =>
+  buttonPressed: (text) ->
     @view?.command(text)
 
-  showAlert: (icon, title, text, result) =>
+  showAlert: (icon, title, text, result) ->
     alert = new AlertView(this, icon, title, text, result)
     @pushView(alert)
 
-  showConfirm: (icon, title, text, yesResult, noResult) =>
+  showConfirm: (icon, title, text, yesResult, noResult) ->
     confirm = new ConfirmView(this, icon, title, text, yesResult, noResult)
     @pushView(confirm)
 

    @showView()


  showView: () =>
    #console.log("View: #{@view.name}")
    @view.doLayout()
    @view.setButtons(@buttonGrid)
    @view.draw()
    $('.game-container .eight-bit-panel').toggle(@view instanceof SplashView);

  pushView: (view) =>
    @stack.unshift(@view)
    @view = view
    @showView()

  popView: (result) =>
    @scene.removeView @view
    parent = @stack.shift()
    if (parent != null)

      resource.data.play()
    @

  playCombatMusic : ->
    @playMusic eburp.data.combatMusic, @getCombatMusicSetting()

  stopMusic : ->
    if @activeTrack and @activeTrack.isReady()
      @activeTrack.data.pause()
      @activeTrack.data.currentTime = 0

  resumeMusic : ->
    if @activeTrack and @activeTrack.isReady()
      @activeTrack.data.play()
    else if @music
      @playMusic @music

  phoneClick: (e, offsetX = 0, offsetY = 0) ->
    relMouse = (event) ->
      canoffset = $(event.currentTarget).offset();
      x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft - Math.floor(canoffset.left);
