Class Texture2DUtility
Texture2D Utility methods.
Inheritance
Inherited Members
Namespace: StansAssets.Foundation
Assembly: cs.temp.dll.dll
Syntax
public static class Texture2DUtility
Methods
MakePlainColorImage(Color, Int32, Int32, Boolean)
Generates plane color
Declaration
public static Texture2D MakePlainColorImage(Color color, int width = 1, int height = 1, bool cacheGeneratedImage = true)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Texture color. |
System.Int32 | width | Texture width. |
System.Int32 | height | Texture height. |
System.Boolean | cacheGeneratedImage | When set to |
Returns
Type | Description |
---|---|
Texture2D |
MakePlainColorImage(String, Int32, Int32, Boolean)
Generates plane color
Declaration
public static Texture2D MakePlainColorImage(string colorHtmlString, int width = 1, int height = 1, bool cacheGeneratedImage = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | colorHtmlString | Case insensitive html string to be converted into a color.
MakeColorFromHtml(String) for more info about |
System.Int32 | width | Texture width. |
System.Int32 | height | Texture height. |
System.Boolean | cacheGeneratedImage | When set to |
Returns
Type | Description |
---|---|
Texture2D |
Resize(Texture2D, Int32, Int32, FilterMode)
Resize Texture2D.
Declaration
public static Texture2D Resize(Texture2D source, int newWidth, int newHeight, FilterMode filterMode)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | source | Source texture to resize. |
System.Int32 | newWidth | New texture width. |
System.Int32 | newHeight | New texture height. |
FilterMode | filterMode | The filtering mode to use during resize. |
Returns
Type | Description |
---|---|
Texture2D |
Rotate(Texture2D, Single)
Rotates
Declaration
public static Texture2D Rotate(Texture2D tex, float angle)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | tex | Source texture to rotate. |
System.Single | angle | Rotate angle. |
Returns
Type | Description |
---|---|
Texture2D |
ScaleTexture(Texture2D, Single, Texture2DUtility.TextureScaleMode)
Scale Texture.
Declaration
public static Texture2D ScaleTexture(Texture2D source, float scale, Texture2DUtility.TextureScaleMode textureScaleMode)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | source | |
System.Single | scale | |
Texture2DUtility.TextureScaleMode | textureScaleMode |
Returns
Type | Description |
---|---|
Texture2D |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |