0

iPhone4 または 5 でタブバーが '@2x' 画像を自動的にロードしないのはなぜですか? これが私のコードです:

local function init()
--Create a group that contains the entire screen and tab bar
mainView = display.newGroup()   

--Create a group that contains the screens beneath the tab bar
tabView = display.newGroup()    
mainView:insert(tabView)

loadScreen("info-moregames")

tabBar = viewController.newTabBar{
        background = "UI_INFO/tabBar.png",  --tab bar background
        default = {"UI_INFO/pogi_no.png","UI_INFO/noads_no.png","UI_INFO/share_no.png","UI_INFO/star_no.png","UI_INFO/restore_no.png","UI_INFO/back_no.png"},
        over = {"UI_INFO/pogi_yes.png","UI_INFO/noads_yes.png","UI_INFO/share_yes.png","UI_INFO/star_yes.png","UI_INFO/restore_yes.png","UI_INFO/back_yes.png"},
        tabs = {"More", "No Ads", "Share","Rate us","Restore","back"}, --names to appear under each tab icon
        onRelease = showScreen  --function to execute when pressed
    }
mainView:insert(tabBar)

tabBar.selected()

return true

終わり

4

1 に答える 1

0

上記のような config.lua ファイルがある場合、画像は自動的にスケーリングされます。

application = {
    content = {
        width = ***,
        height = ***, 
        scale = "letterBox",
}

上記のような config.lua ファイルがある場合、解像度ごとに異なる画像を使用できます。そのためには2つの画像が必要であることに注意してください。たとえば、20x20 の画像 temp.png があるとします。次に、40x40 の別の temp@2x.png が必要です。このようにして、より良い解像度でより良い画像を得ることができます。また、1.5 の値は、デバイスの画面が目的の解像度の 1.5 倍である場合、末尾が @2x の画像を使用することを意味します。

application = {
    content = {
        width = ***,
        height = ***, 
        scale = "letterBox",

        imageSuffix = {
            ["@2x"] = 1.5,
        }
    },
}
于 2013-04-11T10:11:53.847 に答える