-
Notifications
You must be signed in to change notification settings - Fork 278
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
Director.replaceScene for canvas scenes not working #23
Comments
I think I'm having the same issue too. I had it working fine in Canvas, but then I did a major refactoring of the code and now it only works when rendering in DOM. When I turn on CANVAS renderer, Firebug spits out a millon errors saying: canvas.js (line 142) |
in my case I don't get any console errors, it just doesn't show anything on the screen. |
Yeah, in Chrome there were no console errors, but when I tried loading it up in FF with firebug running I saw those canvas.js failures |
Reference link with a workaround: https://groups.google.com/forum/#!topic/limejs/ijQSv2QV1qQ/discussion |
hi @tonistiigi that is exactly what my code above does.. I created this issue after trying the solution from Google Groups.. |
Using canvas renderer only on the layer(not scene) and calling I'll try to look into it in next couple of days. |
I was missing removing the canvas rendering from the scene! now it works. full working code:
|
Hmm.. settingDirty after replacing Scene doesn't seem to make the Canvas layers visible for me. But perhaps it's because I have four different layers in my scene. I set all but one layer to CANVAS and as you see only the DOM layer is drawing. In Console I can 'turn on' the other layers by changing the Renderer by typing: Get in touch at [email protected] if need be... Cheers! |
Sorry but I have trouble understanding whats going on in this code. I did notice that the size of the canvases appears ~450000x450000 so I guess this is related to the problem. If you can limit the problem to a smaller example you can bring it up again in the forums(or here if you think its a bug of limejs). |
It looks like my issue was that the 'canvas' element for my Scene had css set to "display:none". When I hardcoded a css for the page to have ".lime-scene {display:block !important};" the scene showed up just fine. |
Well I know its late but I had the same problem and after trying a lot I found some fix: don't call .setRenderer() before calling your scene to stage. I mean don't call scene2.setRender(lime.Rederer.CANVAS) before calling director.replaceScene(scene2). The same with pushScene. I think this is like limejs works. Limejs don't have only one canvas, and create it on the fly so.. idk its just a guess, but I did it and it works. |
Hi,
I'm not able to replace scenes using director.replaceScene() when
using scenes defined with the Canvas renderer: new
lime.Scene().setRenderer(lime.Renderer.CANVAS);
I just get a blank screen. There is canvas element but it shows
nothing. It does work when I switch scenes with
director.pushScene().
If I remove the CANVAS renderer it works fine with replaceScene().
Is there a way to replace scenes that use the canvas? for a few scenes
it doesn't matter to have the rest hidden, but for too many of them it
could be too resource consuming.
I've tried using layers that are rendered as CANVAS, and doing layer.setDirty(255) after director.replaceScene.
Code below, as you can see if I remove the CANVAS rendering part it works fine.
The text was updated successfully, but these errors were encountered: