Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when play is triggered after sceneEl renderstart event #35

Open
jeromeetienne opened this issue Mar 4, 2018 · 0 comments
Open

Comments

@jeromeetienne
Copy link

jeromeetienne commented Mar 4, 2018

Thanks for your work, really appreciated :)

in the component play function, one can find the following code

this.sceneEl.addEventListener('renderstart', this.onRenderTargetLoaded, false);
// ...
// and later ...
onRenderTargetLoaded: function () {
	console.log('component onRenderTargetLoaded')
	this.sceneEl.removeEventListener('renderstart', this.onRenderTargetLoaded, false);
	this.canvasEl = this.sceneEl.canvas;
	this.addEventListeners();
},

But if play is called after renderstart is triggered, then onRenderTargetLoaded is never called, and .addEventListeners either.

this.sceneEl.addEventListener('renderstart', this.onRenderTargetLoaded, false);
// test if renderstart has already been triggered
if( this.sceneEl.renderStarted ){
	this.onRenderTargetLoaded()
}

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant