Class asset
asset
Defined in: asset.js.
Constructor Attributes | Constructor Name and Description |
---|---|
asset()
Refers to a stored asset from a datastream.
|
Field Attributes | Field Name and Description |
---|---|
Returns the name of the asset.
|
|
Returns whether this asset refers to a real asset or not.
|
Method Attributes | Method Name and Description |
---|---|
get()
Returns the stored asset object containing usable data.
|
|
remove()
Removes the asset from the program.
|
|
write(encoderExtension, Name)
Attempts to dump the asset to a file
The encoder extension specifies which encoder
should handle writing the file.
|
Class Detail
asset()
Refers to a stored asset from a datastream.
Assets represent a stored chunk of useful data
encoded into a format that the engine can use.
Assets are used as the bridge between external resources
and sandboxe itself.
Field Detail
name
Returns the name of the asset. Read-only.
valid
Returns whether this asset refers to a real asset or not.
Method Detail
get()
Returns the stored asset object containing usable data.
remove()
Removes the asset from the program.
write(encoderExtension, Name)
Attempts to dump the asset to a file
The encoder extension specifies which encoder
should handle writing the file. If the extension is not supported, the write will fail
and false will be returned. True is returned if the dump was reported as successful
by the encoder.
- Parameters:
- {String} encoderExtension
- The type of file to write on disk. I.e. png
- {String} Name
- Name of the file to write.