Ignition / Texture2DHelpers
Namespace
Playniax.IgnitionScript can be found in
Assets/Playniax/Framework/Ignition/Framework/Core/Scripts/Texture2DHelpers.cs
Class Texture2DHelpers
DescriptionCollection of Texture2D functions.
Public Methods | Description |
---|
static Texture2D Blit(Texture2D overlayTexture, Texture2D targetTexture, Vector2 position) | Blits texture on top of another one at a specified position. |
static Color32 GetDominantColor(Texture2D texture) | Returns the dominant color of a texture by averaging the RGB values of all pixels in the texture. |
static Texture2D ScaledClone(Texture2D texture, int width, int height, FilterMode mode = FilterMode.Trilinear) | Returns a clone of the texture with the new width and height. |
static void Scale(Texture2D texture, int width, int height, FilterMode mode = FilterMode.Trilinear) | Resizes the texture to the new width and height. |
static Texture2D GetScreenshot() | Returns a screenshot. |
static Sprite TextureToSprite(Texture2D texture, Vector2 pivot, float pixelsPerUnit = 100) | Returns a sprite. |