什么是电晕的简单闪屏代码?

时间:2014-02-27 05:09:55

标签: corona

需要使用lua为Corona创建简单的启动画面的帮助 已经尝试过一个简单的代码,我就像苹果酱一样迷失了

4 个答案:

答案 0 :(得分:5)

splash screen using lua你是什么意思?是否要将iOS应用程序启动屏幕(启动图像)添加到项目中?然后,只需在.png所在的项目文件夹中添加正确的main.lua文件:

这些图片应符合下面列出的标准名称和尺寸,您无需在plist表中指定或在android表中指定

enter image description here

<强>更新
注意:对于iOS,您必须在UILaunchImages表中指定启动图像文件名。

settings =
{
    iphone =
    {
        plist =
        {
            --icon image files table (see section above)
            CFBundleIconFiles = {
            },
            --launch image files table
            UILaunchImages = {
                {  -- iPhone 4 Portrait
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default",
                    ["UILaunchImageOrientation"] = "Portrait",
                    ["UILaunchImageSize"] = "{320, 480}"
                },
                {  -- iPhone 4 LandscapeLeft
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default",
                    ["UILaunchImageOrientation"] = "LandscapeLeft",
                    ["UILaunchImageSize"] = "{320, 480}"
                },
                {  -- iPhone 4 LandscapeRight
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default",
                    ["UILaunchImageOrientation"] = "LandscapeRight",
                    ["UILaunchImageSize"] = "{320, 480}"
                },
                {  -- iPhone 5 Portrait
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-568h",
                    ["UILaunchImageOrientation"] = "Portrait",
                    ["UILaunchImageSize"] = "{320, 568}"
                },
                {  -- iPhone 5 LandscapeLeft
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-568h",
                    ["UILaunchImageOrientation"] = "LandscapeLeft",
                    ["UILaunchImageSize"] = "{320, 568}"
                },
                {  -- iPhone 5 LandscapeRight
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-568h",
                    ["UILaunchImageOrientation"] = "LandscapeRight",
                    ["UILaunchImageSize"] = "{320, 568}"
                },
                {  -- iPad Portrait
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-Portrait",
                    ["UILaunchImageOrientation"] = "Portrait",
                    ["UILaunchImageSize"] = "{768, 1024}"
                },
                {  -- iPad LandscapeLeft
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-Landscape",
                    ["UILaunchImageOrientation"] = "LandscapeLeft",
                    ["UILaunchImageSize"] = "{768, 1024}"
                },
                {  -- iPad LandscapeRight
                    ["UILaunchImageMinimumOSVersion"] = "7.0",
                    ["UILaunchImageName"] = "Default-Landscape",
                    ["UILaunchImageOrientation"] = "LandscapeRight",
                    ["UILaunchImageSize"] = "{768, 1024}"
                },
                {  -- iPhone 6 Portrait
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-667h",
                    ["UILaunchImageOrientation"] = "Portrait",
                    ["UILaunchImageSize"] = "{375, 667}"
                },
                {  -- iPhone 6 LandscapeLeft
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-667h",
                    ["UILaunchImageOrientation"] = "LandscapeLeft",
                    ["UILaunchImageSize"] = "{375, 667}"
                },
                {  -- iPhone 6 LandscapeRight
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-667h",
                    ["UILaunchImageOrientation"] = "LandscapeRight",
                    ["UILaunchImageSize"] = "{375, 667}"
                },
                {  -- iPhone 6 Plus Portrait
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-736h",
                    ["UILaunchImageOrientation"] = "Portrait",
                    ["UILaunchImageSize"] = "{414, 736}"
                },
                {  -- iPhone 6 Plus LandscapeLeft
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-Landscape-736h",
                    ["UILaunchImageOrientation"] = "LandscapeLeft",
                    ["UILaunchImageSize"] = "{414, 736}"
                },
                {  -- iPhone 6 Plus LandscapeRight
                    ["UILaunchImageMinimumOSVersion"] = "8.0",
                    ["UILaunchImageName"] = "Default-Landscape-736h",
                    ["UILaunchImageOrientation"] = "LandscapeRight",
                    ["UILaunchImageSize"] = "{414, 736}"
                },
            },
        }
    },
}

有关详细信息,请访问以下API中的Launch Images部分:Corona Project Build Settings

保持编码..................:)

答案 1 :(得分:1)

如果您尝试创建自己的启动画面,该画面会在有限的时间内显示,您可以使用简单的计时器,并执行类似的操作。

local background = display.newImage( "splash_background.png" )
timer.performWithDelay(1500, leaveScreen)

离开屏幕功能将包含加载下一个场景所需的任何代码。如果您使用旧的导演课,这是我的例子。

local function leaveScreen()
    director:changeScene("Screen_Main")
end

答案 2 :(得分:0)

根据您的选择,启动画面将是图像或矩形。 例如: local background = display.newImage(“img.png”)/ display.newRect(0,0,height,width) background.x = centerX background.y = centerY 组名:插入(背景)

答案 3 :(得分:0)

我现在正在使用lua工作,这是我用于启动画面的代码;这是一个简单的淡入淡出 - 淡出飞溅。这是我的#34;发起&#34;方法(程序中的第一个)

whiteBag是背景图片,白色png。 徽标很好,徽标。 就在它结束之前,它调用一个iniSetup方法,它抛出主菜单。它主要是转换。

function splashScreen()

whiteBag = display.newImage("images/backgrounds/white.png")

whiteBag.alpha = 0
whiteBag.x = display.contentCenterX
whiteBag.y = display.contentCenterY

logo = display.newImage("images/backgrounds/Logo-01.png")

logo.alpha = 0
logo.x = display.contentCenterX
logo.y = display.contentCenterY

transition.to(whiteBag, {transition = easing.inSine, time = 250, delay = 50, alpha = 1})
transition.to(whiteBag, {transition = easing.outSine, time = 250, delay = 900, alpha = 0})

transition.to(logo, {transition = easing.inSine, time = 500, delay = 50, alpha = 1})
transition.to(logo, {transition = easing.outSine, time = 500, delay = 900, alpha = 0, onComplete = mainMenuIn})

startIt = iniSetup()

end
相关问题