Detailed Description

There may be times when you want to display an image for which you only have the Texture2D object, a RenderTexture or an SPA file. In this case, you can add it to the cache with a given name and then access it in PowerUI using cache://theNameYouUsed. The most useful method for this is PowerUI.ImageCache.Add. This avoids having to serialize the image and unserialize it again (i.e. as with the data:// URLs).

Static Public Member Functions

static void Add (string address, Texture image)
 Adds an image to the cache. Texture2D or RenderTexture. More...
 
static void Add (string address, ImageFormat image)
 Adds an image to the cache. Used by e.g. SPA etc. More...
 
static ImageFormat Get (string address)
 Gets a named image from the cache. More...
 
static void Remove (string address)
 Removes an image from the cache. More...
 
static void Clear ()
 Clears the cache of all its contents. More...
 

Static Private Attributes

static Dictionary< string,
ImageFormat
Lookup =new Dictionary<string,ImageFormat>()
 The set of all cached textures. More...
 

Member Function Documentation

static void PowerUI.ImageCache.Add ( string  address,
Texture  image 
)
inlinestatic

Adds an image to the cache. Texture2D or RenderTexture.

Parameters
addressThe name to use to find your image.
imageThe image to store in the cache.
static void PowerUI.ImageCache.Add ( string  address,
ImageFormat  image 
)
inlinestatic

Adds an image to the cache. Used by e.g. SPA etc.

Parameters
addressThe name to use to find your image.
imageThe image to store in the cache.
static void PowerUI.ImageCache.Clear ( )
inlinestatic

Clears the cache of all its contents.

static ImageFormat PowerUI.ImageCache.Get ( string  address)
inlinestatic

Gets a named image from the cache.

Parameters
addressThe name of the image to find.
Returns
A Texture2D if it's found; null otherwise.
static void PowerUI.ImageCache.Remove ( string  address)
inlinestatic

Removes an image from the cache.

Parameters
addressThe name of the image to remove.

Member Data Documentation

Dictionary<string,ImageFormat> PowerUI.ImageCache.Lookup =new Dictionary<string,ImageFormat>()
staticprivate

The set of all cached textures.