Detailed Description

An object which holds and retrieves different types of graphics such as animations, videos (pro only) and textures.

Inheritance diagram for PowerUI.ImagePackage:
PowerUI.ContentPackage Blaze.AtlasEntity Dom.EventTarget Dom.IEventTarget

Public Member Functions

 ImagePackage (string src)
 Creates a new package for the named file to get. The path must be absolute. You must then call PowerUI.ImagePackage.send to perform the request. More...
 
 ImagePackage (string src, Location relativeTo)
 Creates a new package for the named file to get. You must then call PowerUI.ImagePackage.send to perform the request. More...
 
 ImagePackage (ImageFormat contents)
 Creates a package for the given already loaded contents. More...
 
 ImagePackage (Texture image)
 Creates an image package containing the given image. More...
 
 ImagePackage (string src, Location relativeTo, Texture image)
 Creates an image package containing the given image. More...
 
Material GetVideoMaterial (ShaderSet shaders)
 If the package contains a video, this gets the material that the video will playback on. More...
 
Material GetImageMaterial (ShaderSet shaders)
 A material with just the single frame on it. More...
 
Material GetImageMaterial ()
 A material with just the single frame on it using the standard UI shader set. 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 send ()
 Sends the request off. Callbacks such as onreadystatechange will be triggered. More...
 
void AssignImage (Texture image)
 Assign the given image to this package. More...
 
void GotGraphic (Texture image)
 Assigns the given texture to this package, setting it as a 200 OK. More...
 
void GoingOnDisplay (Css.RenderableData context)
 Called when this image is going to be displayed. More...
 
void GoingOffDisplay ()
 Called when this image is no longer being displayed. More...
 
- Public Member Functions inherited from PowerUI.ContentPackage
void setRequestBody (Json.JSObject toPost)
 Sets the PostData from the given JSON object. Changes the content type too. More...
 
void setRequestBody (string toPost)
 Sets the PostData from the given UTF8 string. More...
 
void abort ()
 Aborts this request. More...
 
void AttachForm (UnityEngine.WWWForm form)
 Adds the given form to this request. Note that if you wish to also use custom headers with a form, call this first. Then, add to the Headers property. More...
 
void TimedOut ()
 The request has timed out. More...
 
void NotModified (CachedContent cacheEntry)
 A 304 not modified response. More...
 
void SetPartialResponse (int start, int end, int total)
 Sets the Content-Range response. More...
 
bool GetRange (out int start, out int end)
 Gets the range request header. More...
 
void Failed (int status)
 Goes straight to ready state 4 and the given status. More...
 
- Public Member Functions inherited from Dom.EventTarget
void ClearEvents ()
 Clears all events on this document. More...
 
bool dispatchEvent (Event e)
 Runs an event of the given name. More...
 
void addEventListener (string name, EventListener listener)
 Adds an event listener to this document. More...
 
void addEventListener (string name, EventListener listener, bool useCapture)
 Adds an event listener to this document. More...
 
void removeEventListener (string name, object evtHandlerInternal)
 Removes an event listener from this document. More...
 
void addEventListener (string name, AnimationEventDelegate method)
 
void addEventListener (string name, AudioProcessingEventDelegate method)
 
void addEventListener (string name, BeforeInputEventDelegate method)
 
void addEventListener (string name, BeforeUnloadEventDelegate method)
 
void addEventListener (string name, BlobEventDelegate method)
 
void addEventListener (string name, ClipboardEventDelegate method)
 
void addEventListener (string name, CloseEventDelegate method)
 
void addEventListener (string name, CompositionEventDelegate method)
 
void addEventListener (string name, CustomEventDelegate method)
 
void addEventListener (string name, CSSFontFaceLoadEventDelegate method)
 
void addEventListener (string name, DeviceLightEventDelegate method)
 
void addEventListener (string name, DeviceMotionEventDelegate method)
 
void addEventListener (string name, DeviceOrientationEventDelegate method)
 
void addEventListener (string name, DeviceProximityEventDelegate method)
 
void addEventListener (string name, DomEventDelegate method)
 
void addEventListener (string name, DOMTransactionEventDelegate method)
 
void addEventListener (string name, DragEventDelegate method)
 
void addEventListener (string name, EditingBeforeInputEventDelegate method)
 
void addEventListener (string name, ErrorEventDelegate method)
 
void addEventListener (string name, FetchEventDelegate method)
 
void addEventListener (string name, FocusEventDelegate method)
 
void addEventListener (string name, GamepadEventDelegate method)
 
void addEventListener (string name, HashChangeEventDelegate method)
 
void addEventListener (string name, IDBVersionChangeEventDelegate method)
 
void addEventListener (string name, InputEventDelegate method)
 
void addEventListener (string name, KeyboardEventDelegate method)
 
void addEventListener (string name, MediaStreamEventDelegate method)
 
void addEventListener (string name, MessageEventDelegate method)
 
void addEventListener (string name, MouseEventDelegate method)
 
void addEventListener (string name, MutationEventDelegate method)
 
void addEventListener (string name, OfflineAudioCompletionEventDelegate method)
 
void addEventListener (string name, PageTransitionEventDelegate method)
 
void addEventListener (string name, PointerEventDelegate method)
 
void addEventListener (string name, PopStateEventDelegate method)
 
void addEventListener (string name, ProgressEventDelegate method)
 
void addEventListener (string name, RelatedEventDelegate method)
 
void addEventListener (string name, RTCDataChannelEventDelegate method)
 
void addEventListener (string name, RTCIdentityErrorEventDelegate method)
 
void addEventListener (string name, RTCIdentityEventDelegate method)
 
void addEventListener (string name, RTCPeerConnectionIceEventDelegate method)
 
void addEventListener (string name, SensorEventDelegate method)
 
void addEventListener (string name, StorageEventDelegate method)
 
void addEventListener (string name, TextEventDelegate method)
 
void addEventListener (string name, TimeEventDelegate method)
 
void addEventListener (string name, TouchEventDelegate method)
 
void addEventListener (string name, TrackEventDelegate method)
 
void addEventListener (string name, TransitionEventDelegate method)
 
void addEventListener (string name, UIEventDelegate method)
 
void addEventListener (string name, UserProximityEventDelegate method)
 
void addEventListener (string name, WebGLContextEventDelegate method)
 
void addEventListener (string name, WheelEventDelegate method)
 
void addEventListener (string name, Nitro.DynamicMethod< Nitro.Void > listener)
 
void addEventListener (string name, Nitro.DynamicMethod< Nitro.Void > listener, bool capture)
 
void addEventListener (string name, ContextEventDelegate method)
 
void addEventListener (string name, SlideEventDelegate method)
 
void addEventListener (string name, PowerUI.SpriteEventDelegate method)
 
void addEventListener (string name, SVGEventDelegate method)
 Adds an event listener to this document. More...
 
void addEventListener (string name, SVGZoomEventDelegate method)
 

Public Attributes

ImageFormat Contents
 The contents of this package. A particular format of image, e.g. a video or an spa etc. More...
 
- Public Attributes inherited from PowerUI.ContentPackage
Document hostDocument
 A document to inform when the resource has loaded. More...
 
Location redirectedTo
 A location that the request was redirected to. More...
 
Location location
 The URI that was requested. More...
 
byte[] request
 E.g. posted data. More...
 
string type
 The type of file that was requested (e.g. "woff" or "ttf") More...
 
int statusCode =200
 A HTTP status code if there is one. More...
 
int contentLength
 Total content length. More...
 
int bytesReceived
 Bytes received. More...
 
- Public Attributes inherited from Dom.EventTarget
EventsSet Events
 A set of events for this document. See addEventListener. More...
 

Package Functions

override void ReceivedMovieTexture (MovieTexture tex)
 
override void ReceivedData (byte[] buffer, int offset, int count)
 Called by the file handler when the contents are available. More...
 
- Package Functions inherited from PowerUI.ContentPackage
bool ReceivedHeaders ()
 All headers are ready. Returns true if we're redirecting. More...
 
void ReceivedHeaders (int length)
 All headers are ready. More...
 
bool ReceivedHeaders (string rawHeaders)
 All headers are ready. Returns true if we're redirecting. More...
 
void Done ()
 Goes straight to ready state 4, status 200. More...
 
virtual void ReceivedMovieTexture (UnityEngine.MovieTexture tex)
 

Properties

Type ContentType [get]
 The system type of the content, e.g. PictureFormat. More...
 
bool Loaded [get]
 Checks if this package contains something loaded and useable. More...
 
int Width [get]
 Gets the width of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first. More...
 
int Height [get]
 Gets the height of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first. More...
 
- Properties inherited from PowerUI.ContentPackage
int readyState [get, set]
 Same as XMLHTTPRequest.readyState. More...
 
Headers requestHeaders [get]
 The headers to send with this request. They're lowercase. Status line is indexed as the empty string. More...
 
Headers responseHeaders [get]
 All available headers, parsed as soon as they become available. Status line is indexed as the empty string. More...
 
string rawResponseHeaders [get, set]
 Gets or sets the raw response headers. More...
 
string rawRequestHeaders [get, set]
 Gets or sets the raw response headers. More...
 
string statusText [get]
 The complete response status header. E.g. "HTTP/1.1 200 OK" More...
 
bool started [get]
 True if this request has started up. More...
 
bool ready [get]
 True if this request has at least some data. More...
 
bool ok [get]
 True if there is no error and the text is ok. More...
 
bool errored [get]
 True if there was an error and the text is not ok. More...
 
string contentType [get]
 The response content type. More...
 
float progress [get]
 Download progress. More...
 
int timeout [get, set]
 Timeout in ms. Default is 0. More...
 
UIEventDelegate onreadystatechange [get, set]
 Called when the ready state changes. More...
 
UIEventDelegate onload [get, set]
 Called when it's done loading. More...
 
UIEventDelegate ontimeout [get, set]
 Called when the request times out. More...
 
UIEventDelegate onerror [get, set]
 Called when the request errors. More...
 
UIEventDelegate onabort [get, set]
 Called when the request is aborted. More...
 
- Properties inherited from Dom.EventTarget
static DispatchStack dispatchStackRef [get]
 The active dispatch stack. Use event.deepPath to access it (available during dispatch only). More...
 
virtual EventTarget eventTargetParentNode [get]
 The parent node as used by EventTarget during capture. Can be null. More...
 
virtual NodeList eventTargetChildren [get]
 The childNode set as used by EventTarget during capture. Can be null. More...
 

Private Member Functions

void Clear ()
 Removes all content from this image package. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PowerUI.ContentPackage
void SetPath (string src, Location relativeTo)
 Sets up the filepath to the given url which may be relative to a given location. More...
 
- Package Attributes inherited from PowerUI.ContentPackage
int readyState_
 Same as XMLHTTPRequest.readyState. More...
 
IAbortable abortableObject
 An internal abortable object. More...
 
- Static Package Attributes inherited from Dom.EventTarget
static DispatchStack PooledStack
 The current head of the pooled dispatched stacks. More...
 

Constructor & Destructor Documentation

PowerUI.ImagePackage.ImagePackage ( string  src)
inline

Creates a new package for the named file to get. The path must be absolute. You must then call PowerUI.ImagePackage.send to perform the request.

Parameters
srcThe file to get.
PowerUI.ImagePackage.ImagePackage ( string  src,
Location  relativeTo 
)
inline

Creates a new package for the named file to get. You must then call PowerUI.ImagePackage.send to perform the request.

Parameters
srcThe file to get.
relativeToThe path the file to get is relative to, if any (may be null).
PowerUI.ImagePackage.ImagePackage ( ImageFormat  contents)
inline

Creates a package for the given already loaded contents.

PowerUI.ImagePackage.ImagePackage ( Texture  image)
inline

Creates an image package containing the given image.

Parameters
imageThe image for this image package. Used to display cached graphics.
PowerUI.ImagePackage.ImagePackage ( string  src,
Location  relativeTo,
Texture  image 
)
inline

Creates an image package containing the given image.

Parameters
imageThe image for this image package. Used to display cached graphics.

Member Function Documentation

void PowerUI.ImagePackage.AssignImage ( Texture  image)
inline

Assign the given image to this package.

void PowerUI.ImagePackage.Clear ( )
inlineprivate

Removes all content from this image package.

bool PowerUI.ImagePackage.DrawToAtlas ( TextureAtlas  atlas,
AtlasLocation  location 
)
inline

Draws this entity to the given atlas now.

Implements Blaze.AtlasEntity.

int PowerUI.ImagePackage.GetAtlasID ( )
inline

A globally unique ID that can be used to identify the image being held.

Implements Blaze.AtlasEntity.

void PowerUI.ImagePackage.GetDimensionsOnAtlas ( out int  width,
out int  height 
)
inline

Gets the dimensions of this entity on an atlas.

Implements Blaze.AtlasEntity.

Material PowerUI.ImagePackage.GetImageMaterial ( ShaderSet  shaders)
inline

A material with just the single frame on it.

Material PowerUI.ImagePackage.GetImageMaterial ( )
inline

A material with just the single frame on it using the standard UI shader set.

Material PowerUI.ImagePackage.GetVideoMaterial ( ShaderSet  shaders)
inline

If the package contains a video, this gets the material that the video will playback on.

void PowerUI.ImagePackage.GoingOffDisplay ( )
inline

Called when this image is no longer being displayed.

void PowerUI.ImagePackage.GoingOnDisplay ( Css.RenderableData  context)
inline

Called when this image is going to be displayed.

void PowerUI.ImagePackage.GotGraphic ( Texture  image)
inline

Assigns the given texture to this package, setting it as a 200 OK.

bool PowerUI.ImagePackage.MultiThreadDraw ( )
inline

True if DrawToAtlas can be multithreaded for this object.

Implements Blaze.AtlasEntity.

override void PowerUI.ImagePackage.ReceivedData ( byte[]  buffer,
int  offset,
int  count 
)
inlinepackagevirtual

Called by the file handler when the contents are available.

Reimplemented from PowerUI.ContentPackage.

override void PowerUI.ImagePackage.ReceivedMovieTexture ( MovieTexture  tex)
inlinepackage
void PowerUI.ImagePackage.send ( )
inline

Sends the request off. Callbacks such as onreadystatechange will be triggered.

Member Data Documentation

ImageFormat PowerUI.ImagePackage.Contents

The contents of this package. A particular format of image, e.g. a video or an spa etc.

Property Documentation

Type PowerUI.ImagePackage.ContentType
get

The system type of the content, e.g. PictureFormat.

int PowerUI.ImagePackage.Height
get

Gets the height of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first.

Returns
The height of the graphic.
bool PowerUI.ImagePackage.Loaded
get

Checks if this package contains something loaded and useable.

Returns
True if there is a useable graphic in this package.
int PowerUI.ImagePackage.Width
get

Gets the width of the graphic in this package. Note that you should check if it is PowerUI.ImagePackage.Loaded first.

Returns
The width of the graphic.