Class:ContentProvider

From OpenBlox
Jump to: navigation, search
ContentProvider
Inheritance
Instance

The ContentProvider class allows developers to Preload, get and overwrite content that will be loaded later on. This can be a very powerful class, if used correctly.

Methods

string GetContent(string url)

This method loads content from the location, url. url can be any any string, but if you haven't mapped content with PutContent, only protocols supported by cURL will be loaded, with the exception of the file:// protocol or OenBlox's own res:// protocol, which reads from the project's "res" directory.

void PutContent(string url, string content)

This method preloads content, so that it can be quickly used at a later time. url can be any string, and content can be any string, including base64 content. If content is base64 encoded content, it will be loaded in its' decoded form. Whether url is a valid cURL location, or not, this method will overwrite any content that is already loaded. It is important to note that any entities that are using content loaded from url.

void Preload(string url)

This method preloads content, so that it can be quickly used at a later time. url can be any string accepted by GetContent.

References