如何将图像宽度更改为屏幕宽度的两倍?
How do I change my image width to be twice the size of the screen's width?
我想让我的图片的高度是显示器的高度和两个屏幕宽度的宽度,我试过这种方式,但是图片宽度没有改变。
length = display.actualContentWidth * 2
local image = display.newImage("icon.png",display.contentCenterX,display.contentCenterY)
image.width = length
image.height = display.actualContentHeight
根据手册属性width和height给出原图尺寸。因此更改它们的值很可能不会调整图像的大小。
计算比例因子后,您可以使用 scale
函数将显示对象的大小调整为所需的尺寸。
我想让我的图片的高度是显示器的高度和两个屏幕宽度的宽度,我试过这种方式,但是图片宽度没有改变。
length = display.actualContentWidth * 2
local image = display.newImage("icon.png",display.contentCenterX,display.contentCenterY)
image.width = length
image.height = display.actualContentHeight
根据手册属性width和height给出原图尺寸。因此更改它们的值很可能不会调整图像的大小。
计算比例因子后,您可以使用 scale
函数将显示对象的大小调整为所需的尺寸。