Fusion.Engine.Graphics.SpriteLayer.SetClipRectangle C# (CSharp) Method

SetClipRectangle() public method

public SetClipRectangle ( int index, Rectangle rectangle, Color color ) : void
index int
rectangle Rectangle
color Color
return void
		public void SetClipRectangle ( int index, Rectangle rectangle, Color color )
		{
			if (index<0 || index>=MaxSpriteFrames) {
				throw new ArgumentOutOfRangeException("index", "must be greater or equal to zero and less than MaxClipRectangles (" + MaxSpriteFrames.ToString() + ")");
			}

			var rect	=	new RectangleF( rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height );
			var color4	=	color.ToColor4();
			
			framesData[ index ] = new SpriteFrame( rect, color4 );

			dirty	=	true;
		}