thrice Posted January 16, 2017 Share Posted January 16, 2017 I am attempting to position a rectangle at the bottom left of the tracked node origin using Canvas2d, I can't figure it out for the life of me. http://babylonjs-playground.com/#1N9RJY#77 For example: modifying origin (0,0) does not position the rect at the bottom left of the tracked node. Basically I am building a card game, and would like to be able to position various blocks of text's relative to a particular card (attributes and such) - The cards themselves are planes. Anyone have any ideas, or do I need to take a different overall approach? I saw another example http://babylonjs-playground.com/#1N9RJY#58 - in which a new WorldSpace canvas is created everytime text needs to be rendered, but, is that kosher performance wise? Maybe I'm just hesitant because rendering a canvas seems like an expensive operation (although I haven't drilled into it to see what is actually going on yet) Anyways, the tracked object strategy would be perfect / easiest by far, IF I could set origin. Quote Link to comment Share on other sites More sharing options...
dbawel Posted January 16, 2017 Share Posted January 16, 2017 Try bGui - even though @Temechon doesn't support this any longer - what a shame. DB Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 16, 2017 Share Posted January 16, 2017 Try updating line 22 (parameters x/y) : http://babylonjs-playground.com/#1N9RJY#78 Quote Link to comment Share on other sites More sharing options...
thrice Posted January 31, 2017 Author Share Posted January 31, 2017 @Temechon ya I did that already, the point is, I don't know the height of the things, and babylonjs/webgl seems to be based on a relative positioning strategy, whereas the 2d library sizes/positioning os all relative to the screen size. (If I am understanding correctly) Quote Link to comment Share on other sites More sharing options...
thrice Posted February 4, 2017 Author Share Posted February 4, 2017 Bump, still stumped on this one if anyone has any ideas Quote Link to comment Share on other sites More sharing options...
adam Posted February 4, 2017 Share Posted February 4, 2017 I'm currently working on a fix for this. edit: https://github.com/BabylonJS/Babylon.js/pull/1744 thrice 1 Quote Link to comment Share on other sites More sharing options...
thrice Posted February 5, 2017 Author Share Posted February 5, 2017 22 hours ago, adam said: I'm currently working on a fix for this. edit: https://github.com/BabylonJS/Babylon.js/pull/1744 Thanks @adam !, that should help me out quite a bit, been pulling my hair out over this Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 6, 2017 Share Posted February 6, 2017 @thrice sorry for the big delay to answer you, it doesn't happen often but I was unable to contribute/keep things up with the forum the last few days. I'm about to accept the PR @adam wrote to solve your issue, your hairs will be happy about this. I will build a new preview version of C2D when all the PR about it will be processed, which is in less than a hour. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 6, 2017 Share Posted February 6, 2017 @thrice the preview build is updated and has the feature your requested. Quote Link to comment Share on other sites More sharing options...
thrice Posted February 7, 2017 Author Share Posted February 7, 2017 @Nockawa @adam no problem and thanks so much! I will give it a try tonight 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.