CalculateOrigins() public method

public CalculateOrigins ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D
return void
示例#1
0
        public SlicedTextureRef(Texture2D texture, Rectangle margins)
        {
            this.Texture = texture;
            this.Margins = margins;

            NineSlice = new NineSliceMargins {
                Left = margins.Left,
                Top = margins.Top,
                Right = margins.Width,
                Bottom = margins.Height
            };
            NineSlice.CalculateOrigins(texture);
        }
示例#2
0
        /// <summary>
        /// Sets 9 slice options on the image, this allows it to be cut
        /// into 9 pieces for scaling
        /// </summary>
        /// <returns></returns>
        public UIImage With9Slice(int marginLeft, int marginRight, int marginTop, int marginBottom)
        {
            NineSlice        = true;
            NineSliceMargins = new NineSliceMargins {
                Left   = marginLeft,
                Right  = marginRight,
                Top    = marginTop,
                Bottom = marginBottom
            };
            NineSliceMargins.CalculateOrigins(m_Texture);

            return(this);
        }
示例#3
0
 public void SetBackgroundTexture(Texture2D texture, int marginLeft, int marginRight, int marginTop, int marginBottom)
 {
     m_BackgroundTex = texture;
     if (texture != null)
     {
         NineSliceMargins = new NineSliceMargins
         {
             Left   = marginLeft,
             Right  = marginRight,
             Top    = marginTop,
             Bottom = marginBottom
         };
         NineSliceMargins.CalculateOrigins(texture);
     }
     else
     {
         NineSliceMargins = null;
     }
 }
示例#4
0
 public void SetBackgroundTexture(Texture2D texture, int marginLeft, int marginRight, int marginTop, int marginBottom)
 {
     m_BackgroundTex = texture;
     if (texture != null)
     {
         NineSliceMargins = new NineSliceMargins
         {
             Left = marginLeft,
             Right = marginRight,
             Top = marginTop,
             Bottom = marginBottom
         };
         NineSliceMargins.CalculateOrigins(texture);
     }
     else
     {
         NineSliceMargins = null;
     }
 }
示例#5
0
        /// <summary>
        /// Sets 9 slice options on the image, this allows it to be cut
        /// into 9 pieces for scaling
        /// </summary>
        /// <returns></returns>
        public UIImage With9Slice(int marginLeft, int marginRight, int marginTop, int marginBottom)
        {
            NineSlice = true;
            NineSliceMargins = new NineSliceMargins {
                Left = marginLeft,
                Right = marginRight,
                Top = marginTop,
                Bottom = marginBottom
            };
            NineSliceMargins.CalculateOrigins(m_Texture);

            return this;
        }