Jump to content

Canvas2d, positioning rectangle at bottom left of tracked node


Recommended Posts

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.


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.


Link to comment
Share on other sites

  • 2 weeks later...

@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.


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...