예제 #1
0
 public NinePatchSprite(Texture2D texture, Rectangle? sourceRectangle, int leftBorder, int rightBorder, int topBorder, int bottomBorder):
     base(texture)
 {
     _sourceTextureRectangle = sourceRectangle ?? new Rectangle(0, 0, texture.Width, texture.Height);
     _leftBorder = leftBorder;
     _rightBorder = rightBorder;
     _topBorder = topBorder;
     _bottomBorder = bottomBorder;
     _commulativeFixedWidth = _leftBorder + _rightBorder;
     _commulativeFixedHeight = _topBorder + _bottomBorder;
     MinSize = new Rectangle(0, 0, _commulativeFixedWidth, _commulativeFixedHeight);
     FixedBorder = new Thickness(leftBorder, topBorder, rightBorder, bottomBorder);
     Color = Color.White;
 }
예제 #2
0
 public NinePatchSprite(Texture2D texture, Rectangle? sourceRectangle, Thickness border) :
     this(texture, sourceRectangle, border.Left, border.Right, border.Top, border.Bottom)
 { }