quickb2 world without debug draw ?

Which one of the samples would you recommend to see with the debug draw off.

I tried a set up but did something wrong Cus I still get debug draw on.
If you want to turn off debug draw temporarily, you can do
Code:
qb2_debugDrawSettings.drawFlags = 0;
.

If you want to turn it off permanently, I'd recommend setting qb2World::debugDrawGraphics to null.

If you're using the qb2Stock::newDebugWorld() "constructor", make sure the debugDrawGraphics parameter is null.
dougk16 wrote:
If you want to turn off debug draw temporarily, you can do
Code:
qb2_debugDrawSettings.drawFlags = 0;
.

If you want to turn it off permanently, I'd recommend setting qb2World::debugDrawGraphics to null.

If you're using the qb2Stock::newDebugWorld() "constructor", make sure the debugDrawGraphics parameter is null.


I tried

Quote:
var drawFlags:uint = qb2_debugDrawSettings.flags;
drawFlags = 0;
trace(drawFlags);

and i still see the redraws.

here is the code im using.

Code:
package
{
   import As3Math.geo2d.*;
   import flash.display.*;
   import QuickB2.objects.tangibles.*;
   import QuickB2.stock.*;
   import QuickB2.loaders.qb2FlashLoader;
   import QuickB2.objects.qb2Object;
   import flash.events.MouseEvent;
    import QuickB2.debugging.*;
        import QuickB2.misc.qb2_flags;


   /**
    * Really simple example that pulls in the precompiled QuickB2.swc.
    *
    * @author Doug Koellmer
    */
   public class Main extends Sprite
   {
      public var world:qb2World;
      public var circle:qb2CircleShape;
      public function Main():void
      {
         stage.frameRate = 31;
         var stats:Sprite = new Stats();
         stats.scaleX = stats.scaleY = 3;
         addChild(stats);
         stats.x = 165;
         
         world = qb2Stock.newDebugWorld(new amVector2d(0,30),this.graphics,stage);

         
         
          var drawFlags:uint = qb2_debugDrawSettings.flags;
         
          /* qb2_debugDrawSettings.boundBoxStartDepth = qb2_debugDrawSettings.boundBoxEndDepth =0;
                        qb2_debugDrawSettings.centroidStartDepth = qb2_debugDrawSettings.centroidEndDepth = 0;
                        qb2_debugDrawSettings.boundCircleStartDepth = qb2_debugDrawSettings.boundCircleEndDepth = 2;
                        qb2_debugDrawSettings.dynamicOutlineColor = qb2_debugDrawSettings.staticOutlineColor = 0x000000;*/

          drawFlags = 0;
         trace(drawFlags);

         //world:qb2World = new qb2World();
         world.actor = this;// have to give the world an actor in order to see DisplayObjects.
         //world.debugDragSource = stage;// provide basic mouse interaction based on stage's mouse input.
         world.defaultTimeStep = 2.0/30.0;
         //world.realtimeUpdate = true;

         //defaultTimeStep
         world.start();

         circle = qb2Stock.newCircleShape(new amPoint2d(100,100),50,1);


         var circle2:qb2CircleShape = qb2Stock.newCircleShape(new amPoint2d(100,100),50,1);

         circle.isBullet = true;
         circle.density = 1;

         circle2.isBullet = true;
         circle2.density = 1;
         

         world.addObject(circle2);
         world.addObject(circle);
         
         

         var rectangle:qb2PolygonShape = qb2Stock.newRectShape(new amPoint2d(200,200),50,25,1);
         world.addObject(rectangle);

         var body:qb2Body = qb2Stock.newLineBody(new amPoint2d(300,300),new amPoint2d(400,400),10,1,qb2Stock.ENDS_ROUND);
         world.addObject(body);

         var walls:qb2StageWalls = new qb2StageWalls(stage);
         world.addObject(walls);

         var loader:qb2FlashLoader = new qb2FlashLoader();
         var dog:qb2Body = loader.loadObject(OneDog) as qb2Body;

         var loader2:qb2FlashLoader = new qb2FlashLoader();
         var smiles:qb2Body = loader.loadObject(Smiley) as qb2Body;

         var loader3:qb2FlashLoader = new qb2FlashLoader();
         var group:qb2Group = loader.loadObject(SimpleScene) as qb2Group;


         //world.addObject(dog);

         world.addObject(smiles);
         //world.addObject(group);
         //stage.addEventListener(MouseEvent.CLICK addCircleFunc);
         stage.addEventListener(MouseEvent.CLICK, addCircleFunc);
      }

      public function addCircleFunc(e:MouseEvent):void
      {
         var circle3:qb2CircleShape = qb2Stock.newCircleShape(new amPoint2d(100,100),50,1);
         world.addObject(circle3);
         
         if(circle)
         {
         world.removeObject(circle);
         circle = null;
         } else {
            circle = qb2Stock.newCircleShape(new amPoint2d(100,100),50,1);
            world.addObject(circle);
         }
         

      }
      
      
   }
}
Perhaps it is because you are using the qb2Stock.newDebugWorld()?
That probably sets the debug drawing options for your world, I am just creating a world on my own:
var world:qb2World = new qb2World()
Then, by default you don't have the debug drawing.

Sorry if I didn't understand anything, I'm rather new to quickb2 too 😀

Tamper
How are u creating your shapes? Do you not use qb2Stock? You mind posting some code from your stuff?
Yea, the qb2Stock::newDebugWorld() function takes this.graphics....give it null instead.

For draw flags, you're simply copying the value of qb2_debugDrawSettings.flags to a local variable and then setting that local variable to 0. You have to do qb2_debugDrawSettings.flags = 0 directly.
dougk16 wrote:
Yea, the qb2Stock::newDebugWorld() function takes this.graphics....give it null instead.

For draw flags, you're simply copying the value of qb2_debugDrawSettings.flags to a local variable and then setting that local variable to 0. You have to do qb2_debugDrawSettings.flags = 0 directly.



Thanks doug.


The movieclip that I am using for design purposes seems to work smoother with vector art. I actually thought that pixel would work better but it wasn't the case when I tested it on my phone.
Code:
var loader2:qb2FlashLoader = new qb2FlashLoader();
var artBall:qb2Body = loader.loadObject(ArtBall) as qb2Body;


These are the world settings that seem to work best on my evo4.
Code:
world = qb2Stock.newDebugWorld(new amVector2d(0,30),null,stage);
         world.realtimeUpdate = true;
         world.maximumRealtimeStep = 1.0/3.0;


Time to stop testing and start coding my game! Thanks for your generosity and your help. I will make sure to watch the forum in case any other guys have questions about quickb2. Never know I might be able to help and pass the help forward. 🙂

Long Live Quickb2!!!
Hi, is it possible to turn off the drawDebug and still have active skids in the topDown ?
For every tdTerrain that you add to your world, call tdTerrain::draw() manually and the skids should appear. tdTerrain also has some options for customizing skid color, alpha, duration, etc.
Thanks,
I'm still having difficulties with that

I'm creating defaultTerrain:tdTerrain,
adding actor to it defaultTerrain.actor = new Sprite();
and after that I want to call defaultTerrain.draw()

Just don't Know how to point the graphics from the new sprite ...
// I know I got to have some Sprite object for the graphics property ...

Original thread: https://box2d.org/forum/viewtopic.php?t=6743