Ignition / Texture2DHelpers

Namespace Playniax.Ignition

Script can be found in Assets/Playniax/Framework/Ignition/Framework/Core/Scripts/Texture2DHelpers.cs

Class Texture2DHelpers

Description

Collection of Texture2D functions.

Public MethodsDescription
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.