Jump to content

Center Arcade circle body on sprite (and possible bugs)


Arcanorum
 Share

Recommended Posts

I have a sprite with an anchor of 0.5, 0.5, so the middle of the sprite. How would I add a circle body to the sprite with the center of the circle on the anchor of the sprite, so that if I scaled the sprite, the circle would scale from the middle of the sprite and not from the top left? Seems simple but setCircle (and setSize) seems to be messed up as I've been trying to get them to work all day...

- Circle body size doesn't seem to respect the scale of the parent sprite or its anchor.

Link to comment
Share on other sites

Hi Arcanorum, I haven't used circular bodies but, AFAIK

  • The body is always centered on the sprite, regardless of the sprite's anchor, unless you change the body offset
  • Always resize a circular body w/ setCircle, never setSize (which removes the circle)
  • The body offset refers to the sprite texture, so it's also scaled when the texture (sprite) is scaled
Edited by samme
wrong
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.

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

Loading...
 Share

  • Recently Browsing   0 members

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