/// <summary> /// Draws an anti-aliased line on pixels /// </summary> public static void DrawAALine(this Color[] pixels, int textureWidth, Vector2Int v0, Vector2Int v1, Color color) { if (pixels == null) { throw new ArgumentNullException(nameof(pixels)); } Draw.RasterAALine(v0, v1, (x, y, t) => pixels[x + y * textureWidth] = Color.Lerp(pixels[x + y * textureWidth], color, t)); }
/// <summary> /// Draws an anti-aliased line on the texture /// </summary> public static void DrawAALine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color) { if (texture == null) { throw new ArgumentNullException(nameof(texture)); } Draw.RasterAALine(x0, y0, x1, y1, (x, y, t) => texture.SetPixel(x, y, Color.Lerp(texture.GetPixel(x, y), color, t))); }
/// <summary> /// Draws an anti-aliased line on the texture /// </summary> public static void DrawAALine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color) { if (texture == null) { throw new ArgumentNullException(nameof(texture)); } Draw.RasterAALine(v0, v1, (x, y, t) => texture.SetPixel(x, y, Color.Lerp(texture.GetPixel(x, y), color, t))); }
/// <summary> /// Draws an anti-aliased line on pixels /// </summary> public static void DrawAALine(this Color[] pixels, int textureWidth, int x0, int y0, int x1, int y1, Color color) { if (pixels == null) { throw new ArgumentNullException("pixels"); } Draw.RasterAALine(x0, y0, x1, y1, (x, y, t) => pixels[x + y * textureWidth] = Color.Lerp(pixels[x + y * textureWidth], color, t)); }
/// <summary> /// Draws anti-aliased line on texture /// </summary> public static void DrawAALine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color) { Draw.RasterAALine(x0, y0, x1, y1, (x, y, t) => texture.SetPixel(x, y, Color.Lerp(texture.GetPixel(x, y), color, t))); }
/// <summary> /// Draws anti-aliased line on texture /// </summary> public static void DrawAALine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color) { Draw.RasterAALine(v0, v1, (x, y, t) => texture.SetPixel(x, y, Color.Lerp(texture.GetPixel(x, y), color, t))); }