# Unity2D 背景图铺满与Camera.Size的计算公式

### 资源参数

background.png 2048x640，Sprite的像素单位：100

### 调节camera.size

Camera的Size=3.2的背景的显示效果

### 计算公式

For example, consider a Sprite imported from a 500 pixels wide image. The following table shows the different widths your GameObject would have when rendering that Sprite at different scales along the x-axis, using different values for Pixels to Units:

background.png is 640 pixels tall, and the background Sprite has a Pixel to Unit ratio of 100, so the backgroundobject in the Hierarchy will be 6.4 units tall. However, the orthographic camera’s Size property measures half the height of the screen, so it should be half the height of the background, in units, or 3.2.

posted @ 2014-02-19 16:55  赵青青  阅读(10921)  评论(0编辑  收藏  举报