kick.core.ResourceDescriptor Class
A project is a container of all resources and assets used in a game.
Constructor
kick.core.ResourceDescriptor
-
config
Parameters:
-
config
Objectan object which attributes matches the properties of ResourceDescriptor
Example:
var materialConfig = {
name:"Some material",
shader:"Undefined",
uniforms: {
value:42,
type: kick.core.Constants.GL_FLOAT
}
};
var resourceDescriptorConfig = {
type: "kick/material/Material",
config: materialConfig,
uid: 132
};
var materialDescriptor = new ResourceDescriptor(resourceDescriptorConfig);
Methods
instantiate
-
onSuccess
-
onError=null
Create a instance of the resource by calling the constructor function with
uid (but otherwise uninitialized).
This method is used during project load.
Parameters:
-
onSuccess
Functioncallback function that returns the resource
-
onError=null
Functioncallback function when error occurs
toJSON
()
Object
Returns:
A json data object
updateConfig
-
object
-
filter=null
Updates the configuration with the one from object. The method will use object.toJSON(filter) (if toJSON method exist - otherwise the object are used directly)
Parameters:
-
object
Object -
filter=null
FunctionFilter with function(object): return boolean, where true means include in export.
Properties
config
Object
Configuration of the resource. Optional
name
String
The name may contain '/' as folder separator. The name property is a shorthand for config.name
type
String
class name of the resource (such as 'kick.material.Material')