Search code examples
unity-game-enginengui

How to get camera width and button width in NGUI


I am try to access width and height of NGUI 2D UI camera and also try to access width and height of button create with NGUI.


Solution

  • I just figure out

    UIPanel uiPanel = GameObject.Find ("UI Root").GetComponent<UIPanel>();
    
    print(uiPanel.width");
    print("uiPanel.height");