Class TextureUtilities
Contains many utility functions related to textures
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class TextureUtilities
Methods
| Edit this page View SourceClone(Texture2D)
Clones a texture
Declaration
public static Texture2D Clone(this Texture2D tex)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | tex | The texture to clone |
Returns
Type | Description |
---|---|
Texture2D | Returns a clone of the texture |
FlipDiagonally(Texture2D)
Flips a texture across the diagonal (vertically and horizontally)
Declaration
public static void FlipDiagonally(Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to flip |
FlipHorizontally(Texture2D)
Flips a texture horizontally
Declaration
public static void FlipHorizontally(Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to flip |
FlipVertically(Texture2D)
Flips a texture vertically
Declaration
public static void FlipVertically(Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to flip |
Rotate(Texture2D, RotationType)
Applies a rotation to a texture
Declaration
public static void Rotate(this Texture2D texture, RotationType rotation)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to rotate |
RotationType | rotation | The rotation to be applied |
ToTexture2D(RenderTexture)
Converts a RenderTexture into a Texture2D
Declaration
public static Texture2D ToTexture2D(this RenderTexture rTex)
Parameters
Type | Name | Description |
---|---|---|
RenderTexture | rTex | The render texture to convert |
Returns
Type | Description |
---|---|
Texture2D | Returns the render texture as a texture 2D |