API Docs for: 0.5.5
Show:

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 Object

    an 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);

Item Index

Properties

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 Function

    callback function that returns the resource

  • onError=null Function

    callback function when error occurs

toJSON

() Object

Returns:

Object:

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 Function

    Filter 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')

uid

Number