diff --git a/cherry/components/button.lua b/cherry/components/button.lua index 05c7834..723fa18 100644 --- a/cherry/components/button.lua +++ b/cherry/components/button.lua @@ -118,7 +118,9 @@ function Button:icon(options) end -------------------------------------------------------------------------------- -function Button:text(options) +-- if options.bg = false --> only text button +-- if options.bg is not defined --> default bg is rectangle +function Button:create(options) options = options or {} options = _.defaults( @@ -131,6 +133,7 @@ function Button:text(options) image = 'cherry/assets/images/gui/buttons/rectangle.png', xScale = 1, yScale = 1 + -- color = if defined, colorize bg } ), text = _.defaults( @@ -157,20 +160,25 @@ function Button:text(options) button.anchorX = options.anchorX button.anchorY = options.anchorY - if (options.bg.color) then - local bg = - display.newRoundedRect( - button, - 0, - 0, - options.bg.width, - options.bg.height, - options.bg.cornerRadius - ) - bg:setFillColor(colorize(options.bg.color)) - else - local bg = display.newImage(button, options.bg.image) - bg:scale(options.bg.xScale, options.bg.yScale) + local bg + if (options.bg) then + if (options.bg.width) then + bg = + display.newRoundedRect( + button, + 0, + 0, + options.bg.width, + options.bg.height, + options.bg.cornerRadius + ) + else + bg = display.newImage(button, options.bg.image) + bg:scale(options.bg.xScale, options.bg.yScale) + end + if (options.bg.color) then + bg:setFillColor(colorize(options.bg.color)) + end end Text:create( diff --git a/cherry/components/options.lua b/cherry/components/options.lua index e052680..6dc6c94 100644 --- a/cherry/components/options.lua +++ b/cherry/components/options.lua @@ -53,7 +53,7 @@ function Options:drawLeaderboardButton(view) y = LEADERBOARD_BUTTON_Y, scale = .7, action = function() - Router:open(Router.LEADERBOARD) + Router:open(App.screens.LEADERBOARD) end } ) diff --git a/prepare-icons.sh b/prepare-icons.sh index 3956754..6e7f8d1 100755 --- a/prepare-icons.sh +++ b/prepare-icons.sh @@ -31,8 +31,11 @@ convert "$iosBase" -resize '120x120' -unsharp 1x4 "$xcassetsPath/Icon-60@2x.p convert "$iosBase" -resize '180x180' -unsharp 1x4 "$xcassetsPath/Icon-60@3x.png" convert "$iosBase" -resize '76x76' -unsharp 1x4 "$xcassetsPath/Icon-76.png" convert "$iosBase" -resize '152x152' -unsharp 1x4 "$xcassetsPath/Icon-76@2x.png" +convert "$iosBase" -resize '120x120' -unsharp 1x4 "$xcassetsPath/Icon-120.png" +convert "$iosBase" -resize '152x152' -unsharp 1x4 "$xcassetsPath/Icon-152.png" convert "$iosBase" -resize '167x167' -unsharp 1x4 "$xcassetsPath/Icon-167.png" convert "$iosBase" -resize '1024x1024' -unsharp 1x4 "$xcassetsPath/Icon-1024.png" +echo "created iOS icons in $xcassetsPath/" ## ----------------------------------------------------------------------------- echo 'creating android icons...' @@ -42,5 +45,6 @@ convert "$androidBase" -resize '72x72' -unsharp 1x4 "$androidPath/Icon-hdpi. convert "$androidBase" -resize '96x96' -unsharp 1x4 "$androidPath/Icon-xhdpi.png" convert "$androidBase" -resize '144x144' -unsharp 1x4 "$androidPath/Icon-xxhdpi.png" convert "$androidBase" -resize '192x192' -unsharp 1x4 "$androidPath/Icon-xxxhdpi.png" +echo "created iOS icons in $androidPath/" echo 'done!'