An object which holds and retrieves different types of graphics such as animations, videos (pro only) and textures.
Public Member Functions | |
ImagePackage (string src, string relativeTo) | |
Creates a new text package for the named file to get. You must then call PowerUI.TextPackage.Get to perform the request. More... | |
ImagePackage (string src, string relativeTo, bool useResolution) | |
Creates a new text package for the named file to get. You must then call PowerUI.TextPackage.Get to perform the request. More... | |
ImagePackage (Texture2D image) | |
Creates an image package containing the given image. More... | |
ImagePackage (DynamicTexture image) | |
Creates an image package containing the given dynamic image. More... | |
bool | MultiThreadDraw () |
True if DrawToAtlas can be multithreaded for this object. More... | |
void | GetDimensionsOnAtlas (out int width, out int height) |
Gets the dimensions of this entity on an atlas. More... | |
bool | DrawToAtlas (TextureAtlas atlas, AtlasLocation location) |
Draws this entity to the given atlas now. More... | |
int | GetAtlasID () |
A globally unique ID that can be used to identify the image being held. More... | |
void | Get (OnImageReady imageReady) |
Sends the request off and defines a callback to run when the result is ready. More... | |
void | GotCached (ImagePackage package) |
Called if the same resource was requested before so the image can be redisplayed quickly. This will always preceed some other result function. More... | |
void | GotGraphic (string error) |
Called by the file handler when the response errored. More... | |
void | GotGraphic (DynamicTexture image) |
Called by the file handler when a dynamic atlas texture was retrieved successfully. More... | |
void | GotGraphic (SPA animation) |
Called by the file handler when an animation was retrieved successfully. More... | |
void | GotGraphic (MovieTexture movie) |
Called by the file handler when a video was retrieved successfully. More... | |
void | GotGraphic (Texture2D image) |
Called by the file handler when an image was retrieved successfully. More... | |
void | GoingOnDisplay () |
Called when this image is going to be displayed. More... | |
void | GoingOffDisplay () |
Called when this image is no longer being displayed. More... | |
bool | Loaded () |
Checks if this package contains something loaded and useable. More... | |
int | Width () |
Gets the width of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first. More... | |
int | Height () |
Gets the height of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first. More... | |
Public Attributes | |
SPA | SPAFile |
The animation that is in use, if any. More... | |
bool | IsVideo |
True if PowerUI.ImagePackage.Video was set. More... | |
string | Error |
Any error that occured whilst retrieving the graphic. More... | |
FilePath | File |
The file that was requested. More... | |
bool | Animated |
True if PowerUI.ImagePackage.AnimationInstance was set. More... | |
bool | IsDynamic |
True if PowerUI.ImagePackage.DynamicImage was set. More... | |
string | FileType |
The type of file that was requested (e.g. "png" or "jpg") More... | |
Texture2D | Image |
The image texture retrieved. More... | |
object | ExtraData |
A custom data object for passing anything else when the callback runs. More... | |
MovieTexture | Video |
The video retrieved. More... | |
SPAInstance | Animation |
An instance of the animation retrieved. More... | |
bool | PixelPerfect =true |
True when an image should display itself whilst taking resolution into account. More... | |
DynamicTexture | DynamicImage |
The dynamic image retrieved. More... | |
Properties | |
Material | VideoMaterial [get] |
If the package contains a video, this gets the material that the video will playback on. More... | |
Material | ImageMaterial [get] |
A material with just the single frame on it. More... | |
string | Url [get] |
The fully resolved URL requested. More... | |
bool | Ok [get] |
True if there is no error and the graphic is ok. More... | |
bool | Errored [get] |
True if there was an error and the graphic is not ok. More... | |
Events | |
OnImageReady | ImageReady |
The callback to run when the graphic has been retrieved (or an error occured). More... | |
Private Member Functions | |
void | SetPath (string src, string relativeTo, bool useResolution) |
Sets up the filepath to the given url which may be relative to a given location. More... | |
void | SetPath (string src, string relativeTo) |
Sets up the filepath to the given url which may be relative to a given location. More... | |
void | Clear () |
Removes all content from this image package. More... | |
Private Attributes | |
Material | _VideoMaterial |
The material the video is available from. See PowerUI.ImagePackage.VideoMaterial. More... | |
|
inline |
Creates a new text package for the named file to get. You must then call PowerUI.TextPackage.Get to perform the request.
src | The file to get. |
relativeTo | The path the file to get is relative to, if any (may be null). |
|
inline |
Creates a new text package for the named file to get. You must then call PowerUI.TextPackage.Get to perform the request.
src | The file to get. |
relativeTo | The path the file to get is relative to, if any (may be null). |
useResolution | True if the resolution string should be appended to the name. |
|
inline |
Creates an image package containing the given image.
image | The image for this image package. Used to display cached graphics. |
|
inline |
Creates an image package containing the given dynamic image.
image | The image for this image package. Used to display cached graphics. |
|
inlineprivate |
Removes all content from this image package.
|
inline |
Draws this entity to the given atlas now.
Implements Blaze.AtlasEntity.
|
inline |
Sends the request off and defines a callback to run when the result is ready.
imageReady | The callback to run when the graphic has been retrieved. Note that the callback must check if the result is PowerUI.ImagePackage.Ok. |
|
inline |
A globally unique ID that can be used to identify the image being held.
Implements Blaze.AtlasEntity.
|
inline |
Gets the dimensions of this entity on an atlas.
Implements Blaze.AtlasEntity.
|
inline |
Called when this image is no longer being displayed.
|
inline |
Called when this image is going to be displayed.
|
inline |
Called if the same resource was requested before so the image can be redisplayed quickly. This will always preceed some other result function.
|
inline |
Called by the file handler when the response errored.
error | The error that occured. |
|
inline |
Called by the file handler when a dynamic atlas texture was retrieved successfully.
image | The image received. |
|
inline |
Called by the file handler when an animation was retrieved successfully.
animation | The animation received. |
|
inline |
Called by the file handler when a video was retrieved successfully.
video | The video received. |
|
inline |
Called by the file handler when an image was retrieved successfully.
image | The image received. |
|
inline |
Gets the height of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first.
|
inline |
Checks if this package contains something loaded and useable.
|
inline |
True if DrawToAtlas can be multithreaded for this object.
Implements Blaze.AtlasEntity.
|
inlineprivate |
Sets up the filepath to the given url which may be relative to a given location.
src | The file to get. |
relativeTo | The path the file to get is relative to, if any. May be null. |
useResolution | True if the resolution string should be appended to the name. |
|
inlineprivate |
Sets up the filepath to the given url which may be relative to a given location.
src | The file to get. |
relativeTo | The path the file to get is relative to, if any. May be null. |
|
inline |
Gets the width of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first.
|
private |
The material the video is available from. See PowerUI.ImagePackage.VideoMaterial.
bool PowerUI.ImagePackage.Animated |
True if PowerUI.ImagePackage.AnimationInstance was set.
SPAInstance PowerUI.ImagePackage.Animation |
An instance of the animation retrieved.
DynamicTexture PowerUI.ImagePackage.DynamicImage |
The dynamic image retrieved.
string PowerUI.ImagePackage.Error |
Any error that occured whilst retrieving the graphic.
object PowerUI.ImagePackage.ExtraData |
A custom data object for passing anything else when the callback runs.
FilePath PowerUI.ImagePackage.File |
The file that was requested.
string PowerUI.ImagePackage.FileType |
The type of file that was requested (e.g. "png" or "jpg")
Texture2D PowerUI.ImagePackage.Image |
The image texture retrieved.
bool PowerUI.ImagePackage.IsDynamic |
True if PowerUI.ImagePackage.DynamicImage was set.
bool PowerUI.ImagePackage.IsVideo |
True if PowerUI.ImagePackage.Video was set.
bool PowerUI.ImagePackage.PixelPerfect =true |
True when an image should display itself whilst taking resolution into account.
SPA PowerUI.ImagePackage.SPAFile |
The animation that is in use, if any.
MovieTexture PowerUI.ImagePackage.Video |
The video retrieved.
|
get |
True if there was an error and the graphic is not ok.
|
get |
A material with just the single frame on it.
|
get |
True if there is no error and the graphic is ok.
|
get |
The fully resolved URL requested.
|
get |
If the package contains a video, this gets the material that the video will playback on.
OnImageReady PowerUI.ImagePackage.ImageReady |
The callback to run when the graphic has been retrieved (or an error occured).