UnityEngine.GUIStyle.CalcScreenSize C# (CSharp) Method

CalcScreenSize() public method

Calculate the size of an element formatted with this style, and a given space to content.

public CalcScreenSize ( Vector2 contentSize ) : Vector2
contentSize Vector2
return Vector2
        public Vector2 CalcScreenSize(Vector2 contentSize)
        {
            return new Vector2((this.fixedWidth == 0f) ? Mathf.Ceil((contentSize.x + this.padding.left) + this.padding.right) : this.fixedWidth, (this.fixedHeight == 0f) ? Mathf.Ceil((contentSize.y + this.padding.top) + this.padding.bottom) : this.fixedHeight);
        }

Usage Example

コード例 #1
0
 static public int CalcScreenSize(IntPtr l)
 {
     try {
         UnityEngine.GUIStyle self = (UnityEngine.GUIStyle)checkSelf(l);
         UnityEngine.Vector2  a1;
         checkType(l, 2, out a1);
         var ret = self.CalcScreenSize(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of UnityEngine.GUIStyle::CalcScreenSize