Inherits from NSObject
Declared in PXDebug.h
PXDebug.m

Overview

Provides tweaks and toggles for displaying debugging information about the engine.

This class exposes only static methods.

The tweaks in this class are designed for use in a testing environment and shouldn’t be used in production code.

Tasks

  • + drawBoundingBoxes

    When set to YES, red axis-aligned boxes are drawn around each display object.

  • + drawHitAreas

    When set to YES blue axis-aligned boxes are drawn around each display object’s hit area (the within which touches must land to register).

  • + halveStage

    Renders the entire stage at half scale. This is particularly useful when you need to see what’s going on outside of the stage’s bounds.

  • + calculateFrameRate

    When turned on, the engine’s frame rate is calculated and can be queried via these methods:

  • + countGLCalls

    When turned on, the amount of OpenGl calls performed each frame can be queried with the glCallCount method

  • + glCallCount

    The amount of OpenGL calls performed in the previous frame. This method returns 0 if countGLCalls is set to NO.

  • + logErrors

    When turned on, Pixelwave errors are logged to the console.

  • + timeBetweenFrames

    The amount of time in seconds that passed between the last two frames. This value can be used to calculate the framerate of the application.

  • + timeBetweenLogic

    The duration, in seconds, of the last logic phase.

  • + timeBetweenRendering

    The duration, in seconds, of the last rendering phase.

  • + timeWaiting

    The amount of delay, in seconds, between the last two frames.

Class Methods

calculateFrameRate

When turned on, the engine’s frame rate is calculated and can be queried via these methods:

+ (BOOL)calculateFrameRate

Declared In

PXDebug.m

countGLCalls

When turned on, the amount of OpenGl calls performed each frame can be queried with the glCallCount method

+ (BOOL)countGLCalls

Declared In

PXDebug.m

drawBoundingBoxes

When set to YES, red axis-aligned boxes are drawn around each display object.

+ (BOOL)drawBoundingBoxes

Declared In

PXDebug.m

drawHitAreas

When set to YES blue axis-aligned boxes are drawn around each display object’s hit area (the within which touches must land to register).

+ (BOOL)drawHitAreas

Declared In

PXDebug.m

glCallCount

The amount of OpenGL calls performed in the previous frame. This method returns 0 if countGLCalls is set to NO.

+ (unsigned)glCallCount

Declared In

PXDebug.m

halveStage

Renders the entire stage at half scale. This is particularly useful when you need to see what’s going on outside of the stage’s bounds.

+ (BOOL)halveStage

Declared In

PXDebug.m

logErrors

When turned on, Pixelwave errors are logged to the console.

+ (BOOL)logErrors

Declared In

PXDebug.m

timeBetweenFrames

The amount of time in seconds that passed between the last two frames. This value can be used to calculate the framerate of the application.

+ (float)timeBetweenFrames

Discussion

Returns 0 unless calculateFrameRate is set to YES.

Declared In

PXDebug.m

timeBetweenLogic

The duration, in seconds, of the last logic phase.

+ (float)timeBetweenLogic

Discussion

The logic phase involves all user code invoked via PXEvent_EnterFrame events.

Returns 0 unless calculateFrameRate is set to YES.

Declared In

PXDebug.m

timeBetweenRendering

The duration, in seconds, of the last rendering phase.

+ (float)timeBetweenRendering

Discussion

Returns 0 unless calculateFrameRate is set to YES.

Declared In

PXDebug.m

timeWaiting

The amount of delay, in seconds, between the last two frames.

+ (float)timeWaiting

Discussion

Frames are delayed if a frame finishes before the next frame is scheduled to run. The amount of time allotted to each frame is set through the [PXStage frameRate] property.

Returns 0 unless calculateFrameRate is set to YES.

Declared In

PXDebug.m