我已将Corona SDK版本升级到2013.2076(使用Graphic 2.0)。但是现在我的背景图片无效,应用程序崩溃了。
local background = display.newImageRect("/bg.png", 570, 360 )
background:setReferencePoint( display.CenterReferencePoint )
background.x = display.contentCenterX ; background.y = display.contentCenterY
gameGroup:insert(background)
它在以前版本的Corona SDK中完美运行。我无法确定问题。请帮忙
答案 0 :(得分:3)
随着Corona Build 2013.2076的发布,setReferencePoint
已被弃用。
你可以使用
background.anchorX = 0.5 ;
background.anchorY = 0.5 ;
有关anchors
的详情,请参阅
http://docs.coronalabs.com/guide/graphics/transform-anchor.html
参见此处的示例
http://docs.coronalabs.com/api/type/DisplayObject/anchorX.html
和
http://docs.coronalabs.com/api/type/DisplayObject/anchorY.html