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.

Observable Texture load states

#159

Make Texture node states observable with listeners

new SceneJS.Texture({
    layers: [
        {
            uri:"http://scenejs.org/library/textures/misc/general-zod.jpg"
        }
    ],

    listeners: {
        "state-changed":
                function(event) {
                    switch (event.params.newState) {
                        case SceneJS.Texture.STATE_INITIAL:
                            alert("SceneJS.Texture.STATE_INITIAL");
                            break;

                        case SceneJS.Texture.STATE_LOADING:

                            // At least one layer still loading

                            alert("SceneJS.Texture.STATE_LOADING");
                            break;

                        case SceneJS.Texture.STATE_LOADED:

                            // All layers loaded

                            alert("SceneJS.Texture.STATE_LOADED");
                            break;

                        case SceneJS.Texture.STATE_ERROR:

                            // One or more layers failed to load - Layer
                            // will limp on, remaining in this state

                            alert("SceneJS.Texture.STATE_ERROR: " + params.exception.message || params.exception);
                            break;
                    }
                }
    }
},
        

    //..
        )

Reported by lindsay.kay (at xeolabs) · August 20th, 2010 @ 01:57 PM

State: resolved
Milestone: V0.7.7

Activity

No comments yet.

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.