我的代码在模拟器上运行正常,但是当它在我的设备上时它不会加载任何图像,并且在我的日志中它表示"无法加载(图像名称)" ????
我在" 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 )
------------------这就是全部。
忽略我所做的所有注释部分,看看它是否只显示砖墙但它没有!
我感到很无助。
答案 0 :(得分:0)
也许您的图片已嵌入ICC个人资料?
请参阅图像指南 http://docs.coronalabs.com/api/library/display/newImage.html
答案 1 :(得分:0)
我终于找到了一个解决方案,只是想我会分享我学到的东西。
事实证明,如果图像被编辑,为了显示图像,它不能重命名为.png文件。我不得不将图像保留为.jpeg文件
我希望如果有其他人被卡住会有所帮助!