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

removeBody() does not work with Pixi.js renderer #132

Closed
aroman opened this Issue Nov 28, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@aroman

aroman commented Nov 28, 2014

I'm using the latest Pixi.js and PhysicsJS 0.7.0, but removeBody() does not work, in the sense that the pixels are not removed from the screen. Looking at the code, this is because it seems that the Pixi renderer does not even listen to remove:body anywhere... so it seems this is an omission rather than a case of something existing not working. Is there a reason this doesn't work? Even if there is, the fact that it's inconsistent ought at least to be documented, I think.

@wellcaffeinated

This comment has been minimized.

Show comment
Hide comment
@wellcaffeinated

wellcaffeinated Nov 29, 2014

Owner

thanks. Totally agree. Fix for this coming in 0.7

Owner

wellcaffeinated commented Nov 29, 2014

thanks. Totally agree. Fix for this coming in 0.7

@aroman

This comment has been minimized.

Show comment
Hide comment
@aroman

aroman Nov 29, 2014

I've patched this locally myself against the 0.7 branch, it's pretty trivial:

// extended
connect: function( world ){
    world.on( 'remove:body', this.detach, this );
},

// extended
disconnect: function( world ){
    world.off( 'remove:body', this.detach, this );
},

detach: function(data) {
    this.stage.removeChild(data.body.view);
},

aroman commented Nov 29, 2014

I've patched this locally myself against the 0.7 branch, it's pretty trivial:

// extended
connect: function( world ){
    world.on( 'remove:body', this.detach, this );
},

// extended
disconnect: function( world ){
    world.off( 'remove:body', this.detach, this );
},

detach: function(data) {
    this.stage.removeChild(data.body.view);
},
@aroman

This comment has been minimized.

Show comment
Hide comment
@aroman

aroman Nov 29, 2014

If I have some time in the next few days I'll submit a PR, unless you've fixed it already by then.

aroman commented Nov 29, 2014

If I have some time in the next few days I'll submit a PR, unless you've fixed it already by then.

@wellcaffeinated

This comment has been minimized.

Show comment
Hide comment
@wellcaffeinated

wellcaffeinated Nov 29, 2014

Owner

already done :)

Owner

wellcaffeinated commented Nov 29, 2014

already done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment