We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Noticed while working on a project with Phaser that "P2.Body.offset" doesn't work when the pivot point of the sprite has been changed.
Looking forward to patching this.
Thanks.
Example Code:
function preload() { game.load.image('foo', 'foo.png'); game.load.physics('foo-coll', 'foo.json'); } function create(){ // Enable p2 physics game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.gravity.y = 0; game.physics.p2.restitution = 1; var bar = game.add.sprite(game.world.centerX, game.world.centerY, 'foo'); bar.anchor.setTo(0.5); bar.pivot.x = -200; bar.pivot.y = 300; game.physics.p2.enable(bar, true); bar.body.kinematic = true; bar.body.clearShapes(); bar.body.loadPolygon('foo-coll', 'foo'); bar.body.offset.setTo(this.game.width / 3); }
The text was updated successfully, but these errors were encountered:
By looking at the code I found out that "P2.Body.offset" is never being used. Apparently, this is a feature request instead of bug fix.
Sorry, something went wrong.
P2.Body.offset is now used and applied to the Sprite position during …
628dd1c
…rendering. The values given are normal pixel values, and offset the P2 Body from the center of the Sprite (thanks @Mourtz #2430)
Thanks for submitting this issue. We have fixed this, and the fix has been pushed to the dev branch.
dev
No branches or pull requests
Hi,
Noticed while working on a project with Phaser that "P2.Body.offset" doesn't work when the pivot point of the sprite has been changed.
Looking forward to patching this.
Thanks.
Example Code:
The text was updated successfully, but these errors were encountered: