My Project
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Public Attributes | List of all members
GifTexture Class Reference

Gif Texture, holding a GIF frame contents (pixels, resolution, interval, and texture/sprite references etc.) More...

Public Member Functions

 GifTexture (Color32[] colors, int width, int height, float delaySec, FilterMode filterMode, TextureWrapMode wrapMode)
 
 GifTexture (Texture2D texture2d, float delaySec, bool optimizeMemoryUsgae=true)
 
 GifTexture (Sprite sprite, float delaySec, bool optimizeMemoryUsgae=true)
 
Texture2D GetTexture2D ()
 
Sprite GetSprite ()
 
Sprite GetSprite_OptimizeMemoryUsage (ref Texture2D refTexture2d)
 
void SetColorsToTexture2D (ref Texture2D refTexture2d)
 
void SetDisplay (UnityEngine.UI.Image targetDisplay, ref Texture2D refTexture2d)
 
void SetDisplay (RawImage targetDisplay, ref Texture2D refTexture2d)
 
void SetDisplay (Renderer targetDisplay, ref Texture2D refTexture2d)
 

Public Attributes

Color32[] m_Colors = null
 
int m_Width
 
int m_Height
 
Sprite m_Sprite = null
 
Texture2D m_texture2d = null
 
float m_delaySec = 0
 

Detailed Description

Gif Texture, holding a GIF frame contents (pixels, resolution, interval, and texture/sprite references etc.)

Member Function Documentation

◆ GetSprite()

Sprite GifTexture.GetSprite ( )
inline

Get the stored Sprite, create a new one from the stored Texture2D or m_Colors if not exist. The texture in the sprite will take up certain memory until you clear it. (If just need to display the gif frame, use SetDisplay method instead)

◆ GetTexture2D()

Texture2D GifTexture.GetTexture2D ( )
inline

Get the stored Texture2D, create a new one from m_Colors if not exist. The texture will take up certain memory until you clear it. (If just need to display the gif frame, use SetDisplay method instead)

◆ SetDisplay() [1/3]

void GifTexture.SetDisplay ( RawImage  targetDisplay,
ref Texture2D  refTexture2d 
)
inline

Set the stored pixels(m_Colors) to diaplay on the target RawImage. (Reminder: Do NOT use the same refTexture2d for different GIF! As it will generate new texture each time.)

◆ SetDisplay() [2/3]

void GifTexture.SetDisplay ( Renderer  targetDisplay,
ref Texture2D  refTexture2d 
)
inline

Set the stored pixels(m_Colors) to diaplay on the target Renderer. (Reminder: Do NOT use the same refTexture2d for different GIF! As it will generate new texture each time.)

◆ SetDisplay() [3/3]

void GifTexture.SetDisplay ( UnityEngine::UI::Image  targetDisplay,
ref Texture2D  refTexture2d 
)
inline

Set the stored pixels(m_Colors) to diaplay on the target Image. (Reminder: Do NOT use the same refTexture2d for different GIF! As it will generate new texture each time.)


The documentation for this class was generated from the following file: