I recently started work on a Box2D game project using Starling, and one of my concerns was getting the debug mode to display correctly.
Box2D is a very popular physics engine. It has a debug mode which draws shape outlines, defines center of mass and shows joint connectivity, all very useful while debugging shapes behavior in a physics world. Debug mode is also very useful during prototyping when artistic graphics are not ready. Box2D has its own API but still uses native Flash objects and events.
Starling on the other hand is a game framework developed on top of the Stage3D APIs which helps write fast GPU accelerated games without having to access the Stage3D APIs. The Starling API is very similar to native Flash AS3.
Once a Starling stage instance is created, all display objects subsequently become part of this core Starling instance.
The PlayGame Class is where the Starling framework is initialized. Within the PlayGame class, the Box2D debug sprite instance is defined. The Box2D debug Sprite instance is a native Flash and not a Starling class.
Are you creating and adding the sprite to the flash display list in the main parent class?
Also make sure that the sprite is a static variable.
Hi there, thanks for the tip. Btw we can just overlay the Box2D's native flash debug sprite on top of Starling using..