cx20 Posted June 18, 2016 Share Posted June 18, 2016 I have just tried Canvas2D. http://jsdo.it/cx20/w748 I was hoped to be made dot picture of 16x16 (= 256 items) in Canvas2D. However, a square that can be displayed in Canvas2D was 100 items. Is this a limit? If usage is wrong, I'm sorry. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted June 18, 2016 Share Posted June 18, 2016 16 minutes ago, cx20 said: I have just tried Canvas2D. http://jsdo.it/cx20/w748 I was hoped to be made dot picture of 16x16 (= 256 items) in Canvas2D. However, a square that can be displayed in Canvas2D was 100 items. Is this a limit? If usage is wrong, I'm sorry. I'm on it, I'll tell you as soon as I know. This playground seem to work fine with a high count of primitives: http://babylonjs-playground.com/#OWCCR#8 But the bug you describe reminds me of an issue I got in the past and that I fixed, maybe it's still there. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted June 18, 2016 Share Posted June 18, 2016 Ok, my bad...There's a bug, with such count of object I don't compute the Z-Order correctly, it's a limitation I was aware of, but still don't understand why the PG I mentioned above works and yours don't. Anyway, there's a simple hack to make it work for you, I've fork you sample with the solution: http://jsdo.it/nockawa/IJ9p rect.zOrder = 0.5; rectArray.push(rect); Basically just override the Z of the prim (as they're all not overlapping, it's ok to do that), by setting a value like 0.5 (0 being displayed first, 1.0 being displayed on the top of everything). It's a bug for me to fix, I'll do it asap, again, I was aware of it and should have communicate about it. Sorry for that. Great stuff by the way! cx20 1 Quote Link to comment Share on other sites More sharing options...
cx20 Posted June 18, 2016 Author Share Posted June 18, 2016 Nockawa san Thank you for quick answer! I understood that there was not the limit of 100 items. After adding a code of `rect.zOrder = 0.5`, I was confirmed to be displayed. http://jsdo.it/cx20/gkMa - use WorldSpaceCanvas2D version http://jsdo.it/cx20/aHNm - use ScreenSpaceCanvas2D version Thanks! GameMonetize and Nockawa 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.