Class Index | File Index

Classes


Namespace sandboxe.assets


Defined in: docbase.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Functions and references to assist in storing external or binary assets.
Method Summary
Method Attributes Method Name and Description
<static>  
sandboxe.assets.getSearchPath()
Gets the base search path for loading assets.
<static>  
sandboxe.assets.load(extension, path, isName)
Retrieves an asset object by name or disk path.
<static>  
sandboxe.assets.loadFromBuffer(extension, name, bytes)
Loads an asset form raw binary data.
<static>  
sandboxe.assets.query(type, name)
Returns the asset of the given type and name, if any.
<static>  
sandboxe.assets.setSearchPath(path)
Sets the base search path for loading assets.
<static>  
sandboxe.assets.supportedLoadExtensions(type)
Returns all supported extension strings for loading the given asset type.
<static>  
sandboxe.assets.supportedWriteExtensions(type)
Returns all supported extension strings for writing the given asset type.
Namespace Detail
sandboxe.assets
Functions and references to assist in storing external or binary assets.
Method Detail
<static> {String} sandboxe.assets.getSearchPath()
Gets the base search path for loading assets. The default is sandboxe.engine.getBaseDirectory().
Returns:
{String} The path set as the searching root. See sandboxe.assets.load.

<static> {asset} sandboxe.assets.load(extension, path, isName)
Retrieves an asset object by name or disk path.
Parameters:
{String} extension
The standard extension of the file. For example 'png' would be for PNG images.
{String} path
The path or name of the asset. If the path refers to a stored name within the trunk, raw data referring to the asset is used from within the binary and the disk is not otherwise accessed. If the asset has been loaded before using this function, the same asset reference is returned and a new one is NOT created. In the case that this argument is true and the name is not in the trunk, the disk is searched recursively from the path set from sandboxe.assets.setSearchPath. By default this is the binary directory.
{Boolean} isName
Optional. Says whether the path given is a filename only or a full path. If filename, the file will be searched recursively from the search path. Otherwise, the file is looked for directly.
Returns:
{asset} Reference to the asset.

<static> {asset} sandboxe.assets.loadFromBuffer(extension, name, bytes)
Loads an asset form raw binary data.
Parameters:
{String} extension
The standard extension of the file. For example 'png' would be for PNG images.
{String} name
The name of the asset. Preferrably should be unique.
{Array} bytes
An array of byte values to be interpreted as a byte stream.
Returns:
{asset} Reference to the asset.

<static> {asset} sandboxe.assets.query(type, name)
Returns the asset of the given type and name, if any.
Parameters:
{Number} type
The type of the asset to query. See sandboxe.assets.type
{String} name
The name / path of the asset provided when loading it.
Returns:
{asset} The asset queried. If none, return undefined.

<static> sandboxe.assets.setSearchPath(path)
Sets the base search path for loading assets. The default is sandboxe.engine.getBaseDirectory().
Parameters:
{String} path
The path to set as the searching root. See sandboxe.assets.load.

<static> {Array} sandboxe.assets.supportedLoadExtensions(type)
Returns all supported extension strings for loading the given asset type.
Parameters:
{Number} type
The type of asset to get extensions for. See sandboxe.assets.type
Returns:
{Array} The names of supported extention types.

<static> {Array} sandboxe.assets.supportedWriteExtensions(type)
Returns all supported extension strings for writing the given asset type.
Parameters:
{Number} type
The type of asset to get extensions for. See sandboxe.assets.type
Returns:
{Array} The names of supported extention types.

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Feb 03 2019 18:30:56 GMT-0500 (EST)