Sprite set: uncheck the debug mark in the bottom corner

I developed an iOS application using the Sprite Kit. Anyone who has developed an iOS game with the Sprite Kit knows the label in the bottom corner with debugging information. I am trying to remove debug information in the bottom corner, which gives the number of nodes and fps. (e.g. 1 node 60.0 fps)

I tried the following code in a method -(id)initWithSize:(CGSize)sizein my file .m, but it does nothing. Is this the correct code to remove a debug mark, or is there a better way to remove a shortcut?

SKView *spriteView = (SKView *) self.view;
spriteView.showsNodeCount = NO;
spriteView.showsFPS = NO;
+4
source share
4 answers

-(id)initWithSize:(CGSize)size - , . , SKScene. ViewContoller. ViewController viewWillLayoutSubviews. , - :

skView.showsFPS = YES;
skView.showsNodeCount = YES;

:

skView.showsFPS = NO;
skView.showsNodeCount = NO;

, ..:)

+13

Swift GameScene.swift, "skView.showsFPS" "skView.showsNodeCount", "true" "false". FPS !

+2

spriteView.showsDrawCount=NO . , .

+1

DEBUG , , App Store.

// GameViewController.swift
override func viewDidLoad() {
    super.viewDidLoad()

    let scene = self.sceneManager.scene
    scene.gameDelegate = self

    let skView = self.view as! SKView
    skView.ignoresSiblingOrder = true

#if DEBUG
    skView.showsFPS = true
    skView.showsNodeCount = true
#endif

    skView.presentScene((scene as! SKScene))
}
+1

Source: https://habr.com/ru/post/1536896/


All Articles