I need an ImageStretch method to render images stretched. So far I've been using the following extension method:
public static void ImageStretched(this Batcher batch, in Subtexture subtex, in Rect rect, Color color)
{
batch.SetTexture(subtex.Texture);
batch.Quad(
rect.TopLeft, rect.TopRight, rect.BottomRight, rect.BottomLeft,
subtex.TexCoords0, subtex.TexCoords1, subtex.TexCoords2, subtex.TexCoords3,
color
);
}
The following could be a good starting point for a PR, but decided not to make a PR right away because I wasn't sure which overloads the method should have.
public void ImageStretch(in Subtexture subtex, in Rect rect, Color color)
{
SetTexture(subtex.Texture);
Quad(
rect.TopLeft, rect.TopRight, rect.BottomRight, rect.BottomLeft,
subtex.TexCoords0, subtex.TexCoords1, subtex.TexCoords2, subtex.TexCoords3,
color);
}
public void ImageStretch(in Subtexture subtex, in Rect rect, Color c0, Color c1, Color c2, Color c3)
{
SetTexture(subtex.Texture);
Quad(
rect.TopLeft, rect.TopRight, rect.BottomRight, rect.BottomLeft,
subtex.TexCoords0, subtex.TexCoords1, subtex.TexCoords2, subtex.TexCoords3,
c0, c1, c2, c3);
}
I need an
ImageStretch
method to render images stretched. So far I've been using the following extension method:The following could be a good starting point for a PR, but decided not to make a PR right away because I wasn't sure which overloads the method should have.