Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

How to NOT show the polygon that we loaded using body.loadPolygon?


Recommended Posts

ground = groundGroup.create(0,0,'ramp');game.physics.p2.enable(ground,true, true);// Clear the shapes and load the 'ramp' polygon from the physicsData JSON file in the cacheground.body.clearShapes();ground.body.loadPolygon('physicsData', 'ramp');

So we loaded a polygon but we only want the "ramp" sprite 

ground = groundGroup.create(0,0,'ramp');

 to be shown in the scene and not the polygon body from

ground.body.loadPolygon('physicsData', 'ramp');

How to turn that off. Polygon body is needed since phaser/p2 only have setCircle and setRectangle as the collision body shapes and we want a custom collision bounding box shape. 


Link to comment
Share on other sites


  • Recently Browsing   0 members

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