From ecad26ddba3cfc5179c72818f8137d2ae65dca54 Mon Sep 17 00:00:00 2001 From: chrisdugne Date: Tue, 7 Mar 2017 23:31:22 +0100 Subject: [PATCH] fixed screen.showbands --- components/Options.lua | 1 + components/Screen.lua | 24 ++++++------------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/components/Options.lua b/components/Options.lua index d48eaed..a4c0c3b 100644 --- a/components/Options.lua +++ b/components/Options.lua @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- local Button = require 'cherry.components.button' +local Screen = require 'cherry.components.screen' -------------------------------------------------------------------------------- diff --git a/components/Screen.lua b/components/Screen.lua index b960d4a..16037fc 100644 --- a/components/Screen.lua +++ b/components/Screen.lua @@ -1,6 +1,7 @@ -------------------------------------------------------------------------------- local Button = require 'cherry.components.button' +local Background = require 'cherry.components.background' -------------------------------------------------------------------------------- @@ -38,6 +39,7 @@ end function Screen:showBands(options) options = options or {} + Background:darken() self.topBand = display.newGroup() App.hud:insert(self.topBand) @@ -66,26 +68,8 @@ function Screen:showBands(options) self.bottom.alpha = 0 self.bottom:setFillColor(0) - - self.BG = display.newRect( - App.hud, - display.contentWidth*0.5, - display.contentHeight*0.5, - display.contentWidth, - display.contentHeight - ) - - self.BG.alpha = 0 - self.BG:setFillColor(0) - utils.disabledTouch(self.topRect) utils.disabledTouch(self.bottom) - utils.disabledTouch(self.BG) - - transition.to( self.BG, { - time = 800, - alpha = 0.8 - }) transition.to( self.topRect, { time = 800, @@ -117,10 +101,14 @@ function Screen:showBands(options) scale = 0.65, action = options.back }) + + self.topBand:insert(back) end end function Screen:hideBands() + Background:lighten() + transition.to( self.topBand, { time = 800, y = -display.contentHeight/12