繁体   English   中英

具有Graphic 2.0位置的Corona SDK无法正常工作

[英]Corona SDK with Graphic 2.0 position not working

我已经将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的早期版本中运行良好。 我无法确定问题。 请帮忙

随着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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM