ResourceInterface interface
Contract for a resource.
Signature:
interface ResourceInterface<TOptions extends KeyValueObject = KeyValueObject, TSources extends KeyValueObject = KeyValueObject> extends EventEmitter<ResourceEvents>
Extends: EventEmitter<ResourceEvents>
Remarks
Resources are a fundamental part of the Core3D SDK that power all visual elements and extensions applied to Designs.
Once you create a resource it can be applied using , which will return an object implementing ModifierInterface, specific to the type of resource applied.
Resources are not associated to any specific Design, so you can create a resource and reuse it across any number of Designs.
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
boolean |
Used by isResource(). | |
|
boolean |
Whether the resource is serializable. |
Methods
Method |
Description |
---|---|
Clone the resource. | |
Destroy the resource. | |
Get the default value for an option key. | |
Get all option defaults. | |
Get the unique ID of this resource. | |
Whether the resource is currently rendering. | |
Get any custom metadata for this resource. | |
Get the current value of an option key. | |
Get all current option values. | |
Get the parent resource, if one exists. | |
Get the value of a source key. | |
Get all current source values. | |
Get the resource type. | |
Get the value of an option key, falling back to the default. | |
Get values for all options, falling back to defaults. | |
Load any external resources required by this resource. | |
Render this resource. | |
Reset an option by key back to | |
Reset all options to | |
Reset a source by key back to | |
Reset all sources to | |
Set a unique ID for this resource. | |
Set custom metadata for this resource. | |
Set an option by key. | |
Set options with a key/value object. | |
Set the parent resource, if one exists. | |
Set a source by key. | |
Set sources with a key/value object. | |
Serialize this resource to JSON. |