Class Texture2DDrawingExtensions
Contains all the Texture2D extension methods with respect to drawing on a texture.
Inheritance
Inherited Members
Namespace: InsaneScatterbrain.Extensions
Syntax
public static class Texture2DDrawingExtensions
Methods
DrawLine(Texture2D, Vector2Int, Vector2Int, Color, int)
Draws a line onto the texture of the given color and thickness between a start and end point.
Declaration
public static void DrawLine(this Texture2D texture, Vector2Int start, Vector2Int end, Color color, int thickness)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | The texture. |
UnityEngine.Vector2Int | start | The start point. |
UnityEngine.Vector2Int | end | The end point. |
UnityEngine.Color | color | The line color. |
int | thickness | The line thickness. |
DrawLine(Texture2D, Vector2Int, Vector2Int, Color)
Draws a line onto the texture of the given color between a start and end point.
Declaration
public static void DrawLine(this Texture2D texture, Vector2Int start, Vector2Int end, Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | The texture. |
UnityEngine.Vector2Int | start | The start point. |
UnityEngine.Vector2Int | end | The end point. |
UnityEngine.Color | color | The line color. |
DrawLines(Texture2D, Color, params Vector2Int[])
Draws a line onto the texture of the given color between an array of points. Points[0] is connected to Points[1], Points[1] to Points[2], etc.
Declaration
public static void DrawLines(this Texture2D texture, Color color, params Vector2Int[] points)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | The texture. |
UnityEngine.Color | color | The line color. |
UnityEngine.Vector2Int[] | points | The points to draw lines between. |
DrawRect(Texture2D, Vector2Int, int, int, float, Color)
Draws unfilled rectangle of given color, based on the first corner point, the given width, height and rotation.
Declaration
public static void DrawRect(this Texture2D texture, Vector2Int p0, int width, int height, float angle, Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | The texture. |
UnityEngine.Vector2Int | p0 | The first corner point. |
int | width | The width. |
int | height | The height. |
float | angle | The angle. |
UnityEngine.Color | color | The draw color. |
DrawRectFill(Texture2D, Vector2Int, int, int, float, Color)
Draws filled rectangle of given color, based on the first corner point, the given width, height and rotation.
Declaration
public static void DrawRectFill(this Texture2D texture, Vector2Int p0, int width, int height, float angle, Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | The texture. |
UnityEngine.Vector2Int | p0 | The first corner point. |
int | width | The width. |
int | height | The height. |
float | angle | The angle. |
UnityEngine.Color | color | The draw color. |
DrawRects(Texture2D, IEnumerable<RectInt>, Color32)
Declaration
public static void DrawRects(this Texture2D texture, IEnumerable<RectInt> rects, Color32 color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Texture2D | texture | |
System.Collections.Generic.IEnumerable<T><UnityEngine.RectInt> | rects | |
UnityEngine.Color32 | color |