Ejemplo n.º 1
0
 /// <summary>
 /// Draws line on texture
 /// </summary>
 public static void DrawLine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color)
 {
     if (texture == null)
     {
         throw new ArgumentNullException("texture");
     }
     Draw.RasterLine(x0, y0, x1, y1, (x, y) => texture.SetPixel(x, y, color));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Draws line on texture
 /// </summary>
 public static void DrawLine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color)
 {
     if (texture == null)
     {
         throw new ArgumentNullException("texture");
     }
     Draw.RasterLine(v0, v1, (x, y) => texture.SetPixel(x, y, color));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Draws a line on pixels
 /// </summary>
 public static void DrawLine(this Color[] pixels, int textureWidth, int x0, int y0, int x1, int y1, Color color)
 {
     if (pixels == null)
     {
         throw new ArgumentNullException(nameof(pixels));
     }
     Draw.RasterLine(x0, y0, x1, y1, (x, y) => pixels[x + y * textureWidth] = color);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Draws a line on pixels
 /// </summary>
 public static void DrawLine(this Color[] pixels, int textureWidth, Vector2Int v0, Vector2Int v1, Color color)
 {
     if (pixels == null)
     {
         throw new ArgumentNullException(nameof(pixels));
     }
     Draw.RasterLine(v0, v1, (x, y) => pixels[x + y * textureWidth] = color);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Draws line on texture
 /// </summary>
 public static void DrawLine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color)
 {
     Draw.RasterLine(x0, y0, x1, y1, (x, y) => texture.SetPixel(x, y, color));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Draws line on texture
 /// </summary>
 public static void DrawLine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color)
 {
     Draw.RasterLine(v0, v1, (x, y) => texture.SetPixel(x, y, color));
 }