找回密碼
 注冊帳號

掃一掃,訪問微社區

camera.aspect 長寬比

2015-1-4 01:17| 發布者: 楊炎| 查看: 2098| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: camera.aspect 長寬比varaspect: floatdescription描述the aspect ratio (width divided by height).長寬比(寬度除以高度)。by default the aspect ratio is automatically calculated from the screen's aspect r ...

camera.aspect 長寬比

varaspect: float

description描述

the aspect ratio (width divided by height).

長寬比(寬度除以高度)。

by default the aspect ratio is automatically calculated from the screen's aspect ratio, even if the camera is not rendering to full area. if you modify the aspect ratio of the camera, the value will stay until you call camera.resetaspect(); which resets the aspect to the screen's aspect ratio.

默認的長寬比是從屏幕的長寬比計算得到的,紀實相機沒有被渲染全屏。如果你修改了相機的aspect比,這個值價格保持到你調用camera.resetaspect(),這將重置長寬比為屏幕的長寬比。

參見:screen類.

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

if (camera.aspect > 1.0f)

print("screen is more wide than tall!");

else

print("screen is more tall than wide!");

}

}

if (camera.aspect > 1.0)

print ("screen is more wide than tall!");

else

print ("screen is more tall than wide!");

相關閱讀

文章點評
相關文章
女校游泳队彩金