new PodJS(options)
Parameters:
Name | Type | Argument | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
An Object containing options for the environment. Parameters:
|
- Source:
Classes
Members
-
<static> POD_CLASSES :object
-
Object providing a map of all pod class names to the corresponding pod class. New pod classes are registered via PodJS.REGISTER_POD_CLASS.
Type:
- object
- Source:
Methods
-
<static> REGISTER_POD_CLASS(podName, podClass)
-
Called by Pods to reigster with the environment.
This should never be called by an application. Pods call this method when the browser has loaded their class.
Parameters:
Name Type Description podName
The universally-unique name (across all Pods anyone has ever written) of the pod to register. Use podjs.com to register your name. podClass
The pointer to the constructor function of the class that is used to create a new pod. - Source:
-
getOptions() → {PodJS.Options}
-
- Source:
Returns:
A clone of the options passed to this environment.- Type
- PodJS.Options
-
pod(name) → {Pod}
-
Retrieves the instance of the pod with the given name that is bound to this environment. If there is no such pod registered, the PodJS environment will instantiate one. Note this might also cause a cascade of other pods to be instantiated and registered.
Only pod classes that have been registered can be instantiated. This is normally accomplished by adding script tags to the html file.
Parameters:
Name Type Description name
string The name and major version of the pod to retrieve (e.g. "scratch"). - Source:
Returns:
The instance of the pod with the given name that is registered with this environment.- Type
- Pod
-
resetAllScripts()
-
Resets all scripts in all pods back to the first instruction.
- Source:
-
tick()
-
Called at approximately 30 frames per second to animate all resources.
This calls tick on each registered pod, resource and script.
- Source: