Skip to content

Commit

Permalink
fixed screen.showbands
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdugne committed Mar 7, 2017
1 parent a18fba4 commit ecad26d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
1 change: 1 addition & 0 deletions components/Options.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--------------------------------------------------------------------------------

local Button = require 'cherry.components.button'
local Screen = require 'cherry.components.screen'

--------------------------------------------------------------------------------

Expand Down
24 changes: 6 additions & 18 deletions components/Screen.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--------------------------------------------------------------------------------

local Button = require 'cherry.components.button'
local Background = require 'cherry.components.background'

--------------------------------------------------------------------------------

Expand Down Expand Up @@ -38,6 +39,7 @@ end

function Screen:showBands(options)
options = options or {}
Background:darken()

self.topBand = display.newGroup()
App.hud:insert(self.topBand)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ecad26d

Please sign in to comment.