Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you set a body's position? #7

Open
catmanjan opened this issue Mar 29, 2014 · 2 comments
Open

How do you set a body's position? #7

catmanjan opened this issue Mar 29, 2014 · 2 comments

Comments

@catmanjan
Copy link

Tried setPosition and position.set but they seem to have no effect.

@catmanjan
Copy link
Author

Found body.revive(x, y); which does what I want it to do, but the coordinates are off for circle bodies, seems to be aligning to center, rather than top-left (which is what happens at circle body creation).

@WingEraser
Copy link
Member

setPosition does work. They are box2d coordinates. Either you have to do x/ratio and y/ratio or use B2FlxV2. Every shape in Box2D is aligned center. I should introduce a new method to do top-left positioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants