Corona的屏幕适配

来源:互联网 发布:实惠猪软件怎么样 编辑:程序博客网 时间:2024/06/05 16:00
  1. display.contentWidthdisplay.contentHeight的值等于config.lua中的widthheight
    content =    {        width = 320,        height = 480,         scale = "letterBox",        fps = 30,    },
  1. The internal coordinate system is also dependent on the content area, with coordinates (0,0) residing in the top-left corner of the content area, not necessarily the top-left corner of the screen.

  2. The content area is defined by the width and height values in config.lua. If you omit or set either of these values to 0, content scaling will not be used.

  3. display.contentScaleXdisplay.contentScaleY:宽与高的缩放比例

  4. display.pixelWidthdisplay.pixelHeight:屏幕的真实宽、高

  5. display.screenOriginXdisplay.screenOriginY:屏幕的左上角坐标,以缩放后的内容区域的左上角为原点

例子如下:

contentWidth = 320contentHeight = 480actualContentWidth = 320actualContentHeight = 568.88891601562display.screenOriginX = -0display.screenOriginY = -44viewableContentWidth = 320viewableContentHeight = 480pixelWidth = 1080pixelHeight = 1920contentScaleX = 0.29629629850388contentScaleY = 0.29629629850388
0 0
原创粉丝点击