FairyGUI.Image.SetNativeSize C# (CSharp) Method

SetNativeSize() public method

public SetNativeSize ( ) : void
return void
        public void SetNativeSize()
        {
            float oldWidth = _contentRect.width;
            float oldHeight = _contentRect.height;
            if (_texture != null)
            {
                _contentRect.width = _texture.width;
                _contentRect.height = _texture.height;
            }
            else
            {
                _contentRect.width = 0;
                _contentRect.height = 0;
            }
            if (oldWidth != _contentRect.width || oldHeight != _contentRect.height)
                OnSizeChanged(true, true);
        }

Usage Example

Example #1
0
 static public int SetNativeSize(IntPtr l)
 {
     try {
         FairyGUI.Image self = (FairyGUI.Image)checkSelf(l);
         self.SetNativeSize();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }