Krekin
Krekin

Reputation: 1562

Can I selectively display physicsBody's?

In GameViewController I have this:

-(void)viewDidLoad
{
    [super viewDidLoad];

    //Configure the view.
    self.skView = (SKView *)self.view;
    self.skView.showsFPS = YES;
    self.skView.showsNodeCount = YES;
    self.skView.showsPhysics = YES; //<<<<<QUESTION ABOUT THIS

    //Create & configure the scene.
    self.scene = [GameScene sceneWithSize:self.skView.bounds.size];
    self.scene.scaleMode = SKSceneScaleModeAspectFill;

    //Present the scene.
    [self.skView presentScene:self.scene];

}

When showsPhysics = YES, is there some code I could write that displays only the physicsBody's that I want to display? Some physicsBody's look really good in combination with some sprites during gameplay.

Upvotes: 1

Views: 37

Answers (1)

sangony
sangony

Reputation: 11696

You cannot selectively show physics bodies using self.skView.showsPhysics. You can however use SKShapeNode to pretty much have the same effect as showing your physics body. Using SKShapeNode will also give you greater control by using some of its fill properties and stroke properties.

Upvotes: 1

Related Questions