把一张图片粘贴到右下角

如何将图像粘贴在屏幕的右下角?

local screenGroup = self.view
helpbtn = display.newImage("helpbtn.png")
screenGroup:insert(helpbtn)
helpbtn.x = 255; helpbtn.y = 600
transition.to( helpbtn, { time=2500, y=465, transition=easing.inOutExpo } )

那么在所有不同的设备上,它看起来都是一样的吗?

点赞
用户869951
用户869951

使用 display.contentWidthdisplay.contentHeight。还可以查看其他 Stack Overflow 帖子,比如 Corona SDK 跨设备屏幕分辨率,以及在 Google 上搜索 "corona lua screen (size OR resolution)"。

2014-01-07 22:07:58
用户1979583
用户1979583
尝试这个:

local distanceFromCorner = 5 local helpbtn = display.newImage(“helpbtn.png”) screenGroup:insert(helpbtn) helpbtn.x = display.contentWidth - helpbtn.contentWidth/2 - distanceFromCorner; helpbtn.y = display.contentHeight - helpbtn.contentHeight/2 - distanceFromCorner;

```

你还可以在普通 corona 模式中使用 [object:setReferencePoint(display.BottomRightReferencePoint)](http://docs.coronalabs.com/api/type/DisplayObject/setReferencePoint.html)或在 Corona 的 Graphics 2.0 引擎中使用 [Anchor Points](http://coronalabs.com/blog/2013/10/15/tutorial-anchor-points-in-graphics-2-0/)。

继续编码............... :)

2014-01-08 15:00:35