Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 将图像粘贴到右下角_Lua_Coronasdk - Fatal编程技术网

Lua 将图像粘贴到右下角

Lua 将图像粘贴到右下角,lua,coronasdk,Lua,Coronasdk,如何将图像粘贴到屏幕的右下角 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 } ) 因此,在所有不同的设备上,它看起来都一样?使用di

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

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 } )

因此,在所有不同的设备上,它看起来都一样?

使用display.contentWidth和display.contentHeight。另外,看看谷歌上的其他SO帖子,比如“corona lua屏幕(大小或分辨率)”

试试这个:

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模式或corona的Graphics 2.0引擎中使用


继续编码………..)

你的意思是定位在同一个地方,还是占据屏幕的同一部分?我的意思是,屏幕大小总是在角落里