Jump to content

Anchor Sprite2D


Recommended Posts

Hi all!

I'm working on Canvas2D and I have problem with position of Sprite2D. Currently, origin only support for rotation and scale :(.

Default, position coordinate bottom/left corner, I want to position coordinate (0,0) is center of Sprite2D (same as anchor property Sprite of Pixi.js, Phaser.js). How to do this?

Thanks for all!

Sorry my bad English. :)

Link to comment
Share on other sites

Thanks for answer :)

But seem you misunderstand me. As same as rotation, if origin (0.5,0.5) then sprite2D will rotate at the center. I also want to position coordinate system start at the center.

You can see: https://www.babylonjs-playground.com/#R3W60Q

Uncomment line 24, that is what I want.

Thanks so much :)

Edited by SinhNQ
Link to comment
Share on other sites

*nod, thx*.  Yeah. I'm not sure HOW to hard-set that sprite2D center.

Fellow forum helpers... SinhNQ would like the sprite2d to be centered by default... like this.

BUT, without needing line 24.

Perhaps wrap it within Group2d or Rect2d?  Nah, that doesn't sound right.  :)

I'll keep thinking, S.  Hopefully, somebody has a solution.

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