protected override Texture CreateTexture(Size size, GraphicsLoadContext loadContext) { return(MappedImageUtility.CreateTexture(loadContext, size, spriteBatch => { var requiresFlip = !loadContext.GraphicsDevice.IsUvOriginTopLeft; var leftWidth = _left.Coords.Width; var rightWidth = _right.Coords.Width; var leftRect = new Rectangle(0, 0, leftWidth, size.Height); spriteBatch.DrawImage( _left.Texture.Value, _left.Coords, leftRect.ToRectangleF(), ColorRgbaF.White, requiresFlip); var middleRect = new Rectangle(leftRect.Right, 0, size.Width - leftWidth - rightWidth, size.Height); spriteBatch.DrawImage( _middle.Texture.Value, _middle.Coords, middleRect.ToRectangleF(), ColorRgbaF.White, requiresFlip); var rightRect = new Rectangle(middleRect.Right, 0, rightWidth, size.Height); spriteBatch.DrawImage( _right.Texture.Value, _right.Coords, rightRect.ToRectangleF(), ColorRgbaF.White, requiresFlip); })); }
protected override Texture CreateTexture(Size size, GraphicsLoadContext loadContext) { return MappedImageUtility.CreateTexture(loadContext, size, spriteBatch => { spriteBatch.DrawImage( _mappedImage.Texture.Value, _mappedImage.Coords, new Rectangle(Point2D.Zero, size).ToRectangleF(), ColorRgbaF.White); }); }
protected override Texture CreateTexture(Size size, GraphicsLoadContext loadContext) { return(MappedImageUtility.CreateTexture(loadContext, size, spriteBatch => { var requiresFlip = !loadContext.GraphicsDevice.IsUvOriginTopLeft; spriteBatch.DrawImage( _mappedImage.Texture.Value, _mappedImage.Coords, new Rectangle(Point2D.Zero, size).ToRectangleF(), ColorRgbaF.White, requiresFlip); })); }
protected override Texture CreateTexture(Size size, GraphicsLoadContext loadContext) { return(MappedImageUtility.CreateTexture(loadContext, _mappedImage)); }