Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Expose state of SceneJS.Load<xx> nodes through API

#70

Add ability to get state of SceneJS.Load and SceneJS.LoadCollada nodes.

A SceneJS.Load node has four states it can be in:

  • STATE_INITIAL - node has been defined, but not rendered yet and hence has not yet made its load request
  • STATE_LOADING - has made its load request and is waiting for the response, which it will receive on a future render of its scene graph
  • STATE_LOADED - has successfully received its response and loaded the content into its subgraph
  • STATE_ERROR - attempted to load but failed (eg. HTTP 404) and now permanently inactivated by SceneJS

When a SceneJS.Load has not been rendered in a while (maybe it's within a SceneJS.Boundary that's been outside of the view frustum for a long time) it may transition back to STATE_INITIAL when SceneJS evicts it's subgraph from the scene to reclaim memory.

Provide a new method, SceneJS.Load.getState() to query the node's state, plus a "state-changed" event to listen to through the new SceneJS.Node event API.

for example:

var myLoad = new SceneJS.Load({ uri: "http://foo.com/..." });

var handler = function(node, params) {
                  alert("Node " + node.getType() + " has changed state to " + node.getState());
             };
 
myLoad.addListener("state-changed", handler,

               // Listener options
               {
                     scope: this   // Optional scope for handler call, defaults to this
               });
 
myLoad.removeListener("state-changed", handler);

Reported by lindsay.kay (at xeolabs) · May 12th, 2010 @ 12:52 PM

State: resolved
Milestone: V0.7.5

Activity

  1. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)
    • State changed from new to resolved

    May 16th, 2010 @ 01:28 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.