Skip to content

Commit

Permalink
Improve support for tvOS. Exclude more icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lerg committed Jan 29, 2016
1 parent 086d3bb commit a569e2c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 59 deletions.
Binary file removed Icon-120.png
Binary file not shown.
Binary file modified Icon-osx.icns
Binary file not shown.
84 changes: 26 additions & 58 deletions build.settings
Expand Up @@ -55,64 +55,6 @@ settings = {
topShelfImage = 'Icon-tvOS-TopShelf.png', -- 1920x720
launchImage = 'Icon-tvOS-Launch.png' -- 1920x1080
},
excludeFiles = {
all = {
'icon1024.png',
'icon1024-iOS.png',
'*.keystore',
'maps/*.tmx'},
iphone = {
'Banner*.png',
'Icon*dpi.png',
'Icon-tvOS*.png',
'Icon*.ico',
'Icon*.icns'
},
tvos = {
'launchscreen.nib',
'Banner*.png',
'Default*.png',
'Icon*.png',
'Icon*.ico',
'Icon*.icns'
},
android = {
'launchscreen.nib',
'Default*.png',
'Icon.png',
'Icon@2x.png',
'Icon-Small-40.png',
'Icon-Small-40@2x.png',
'Icon-60.png',
'Icon-60@2x.png',
'Icon-60@3x.png',
'Icon-72.png',
'Icon-72@2x.png',
'Icon-76.png',
'Icon-76@2x.png',
'Icon-Small-50.png',
'Icon-Small-50@2x.png',
'Icon-Small.png',
'Icon-Small@2x.png',
'Icon-tvOS*.png',
'Icon*.ico',
'Icon*.icns'
},
osx = {
'launchscreen.nib',
'Banner*.png',
'Default*.png',
'Icon*.png',
'Icon*.ico'
},
win32 = {
'launchscreen.nib',
'Banner*.png',
'Default*.png',
'Icon*.png',
'Icon*.icns'
}
},
window = {
defaultMode = 'fullscreen',
defaultViewWidth = 1280,
Expand All @@ -126,5 +68,31 @@ settings = {
plugins = {
['plugin.iCloud'] = {publisherId = 'com.coronalabs', supportedPlatforms = {iphone = true, appletvos = true, ['iphone-sim'] = true, osx = true}},
['plugin.bit'] = {publisherId = 'com.coronalabs'} -- Needed for Tiled loader
},
excludeFiles = {
all = {
'Banner-*.png',
'Icon-*dpi.png',
'Icon-tvOS-*.png',
'*.icns',
'*.ico',
'icon1024.png',
'icon1024-iOS.png',
'*.keystore',
'maps/*.tmx',
'prepare_icons.sh'}
}
}

local iPhoneIcons = {}
for i = 1, #settings.iphone.plist.CFBundleIconFiles do
iPhoneIcons[i] = settings.iphone.plist.CFBundleIconFiles[i]
end
iPhoneIcons[#iPhoneIcons + 1] = '*.nib'
iPhoneIcons[#iPhoneIcons + 1] = 'Default-*.png'
iPhoneIcons[#iPhoneIcons + 1] = 'iTunes*'

settings.excludeFiles.tvos = iPhoneIcons
settings.excludeFiles.android = iPhoneIcons
settings.excludeFiles.osx = iPhoneIcons
settings.excludeFiles.win32 = iPhoneIcons
1 change: 0 additions & 1 deletion prepare_icons.sh
Expand Up @@ -12,7 +12,6 @@ convert "$base" -resize '80x80' -unsharp 1x4 "Icon-Small-40@2x.png"
convert "$base" -resize '100x100' -unsharp 1x4 "Icon-Small-50@2x.png"
convert "$base" -resize '114x114' -unsharp 1x4 "Icon@2x.png"
convert "$base" -resize '120x120' -unsharp 1x4 "Icon-60@2x.png"
convert "$base" -resize '120x120' -unsharp 1x4 "Icon-120.png"
convert "$base" -resize '144x144' -unsharp 1x4 "Icon-72@2x.png"
convert "$base" -resize '152x152' -unsharp 1x4 "Icon-76@2x.png"
convert "$base" -resize '180x180' -unsharp 1x4 "Icon-60@3x.png"
Expand Down
16 changes: 16 additions & 0 deletions scenes/menu.lua
Expand Up @@ -130,6 +130,22 @@ function scene:gotoPreviousScene()
end)
end

function scene:show(event)
if event.phase == 'did' then
-- Tell tvOS that the menu button should be handled by the OS and exit the app
system.activate('controllerUserInteraction')
end
end

function scene:hide(event)
if event.phase == 'will' then
-- Take control over the menu button on tvOS
system.deactivate('controllerUserInteraction')
end
end

scene:addEventListener('create')
scene:addEventListener('show')
scene:addEventListener('hide')

return scene

0 comments on commit a569e2c

Please sign in to comment.