【问题标题】:corona sdk fails to load images--- all of themcorona sdk 无法加载图像——所有图像
【发布时间】:2015-01-29 02:11:45
【问题描述】:

我的代码在模拟器上运行良好,但是当它在我的设备上时,它不会加载任何图像,并且在我的日志上显示“加载失败(图像名称)”????

我在“lua.main”所在的文件夹中调用了所有图像。

这是代码---------------

--local physics = require("physics")
--physics.start()
--physics.setGravity( 0, 6 )
--system.activate( "multitoch" )
--physics.setDrawMode( "normal" )

centerX = display.contentCenterX
centerY = display.contentCenterY
--secCounted = 0
--W = display.contentWidth

--display.setStatusBar( display.HiddenStatusBar )

--timer.performWithDelay( 1000, secCounter, 0 )

--local leftwall = display.newRect(0, 0, 1, 9000)
--local rightwall = display.newRect(W, 0, 1, 9000)
--local top = display.newRect(0, 0, 9000, 160)

--physics.addBody(leftwall, "static")
--physics.addBody(rightwall, "static")
--physics.addBody(top, "static")

local brickwall = display.newImage( "wall.png", centerX, centerY )

--local blackbar = display.newImage( "bar.png", centerX, 0 )

--local direct = display.newText( "Don't let the balloon touch", centerX, centerY, nil, 57         )
--local direct2 = display.newText( "the bottom or top.", centerX, centerY + 55, nil, 57 )
--local direct3 = display.newText ( "You exit through the sides!", centerX, centerY + 110,  nil, 57 )
--direct:setTextColor( 0, 0, 0 )
--direct2:setTextColor( 0, 0, 0 )
--direct3:setTextColor( 0, 0, 0 )

--local ground = display.newImage("floor.png", centerX, 1315 )
--physics.addBody( ground, "static", { friction = 1, bounce = .1 } )

--local function directions( event )
--  direct.text = ""
--  direct2.text = ""
--  direct3.text = ""
--end

--timer.performWithDelay( 9000, directions, 1 )

--local function addBalloon( event )
    --  local bballoon = display.newImage( "bbl.png", centerX, 300 )
    --  physics.addBody( bballoon, { friction = 3.0, bounce = .2 } )

    --function moveBalloon( event )
        --bballoon:applyLinearImpulse( 0, -3, event.x, event.y )
    --end

    --bballoon:addEventListener( "tap", moveBalloon )
--end

--timer.performWithDelay( 10000, addBalloon, 0 )

--local function secCounter( event )
    --  secCounted = secCounted + 1
    --  local blackbar = display.newImage( "bar.png", centerX, 0 )
    --  local myText = display.newText( secCounted, centerX, 50, nil, 100 )
--end

--timer.performWithDelay( 1000, secCounter, 0 )

------------------就是这样。

忽略我所做的所有评论部分,看看它是否只会显示砖墙,但它没有!

我感到无助。

【问题讨论】:

    标签: ios sdk lua coronasdk


    【解决方案1】:

    也许您的图像已嵌入 ICC 配置文件?

    查看图片指南 http://docs.coronalabs.com/api/library/display/newImage.html

    【讨论】:

      【解决方案2】:

      我终于找到了解决方案,只是想我会分享我学到的东西。

      事实证明,为了显示图像,如果图像被编辑,则无法将其重命名为 .png 文件。我不得不将图像保留为 .jpeg 文件

      如果其他人遇到困难,我希望能有所帮助!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-01-17
        • 1970-01-01
        • 1970-01-01
        • 2013-05-12
        • 1970-01-01
        • 2013-11-06
        • 2015-09-02
        相关资源
        最近更新 更多