{"id":441,"date":"2009-11-18T10:50:13","date_gmt":"2009-11-18T17:50:13","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2422"},"modified":"2009-11-18T10:50:13","modified_gmt":"2009-11-18T17:50:13","slug":"quickbox2d-custom-debug-draw","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=441","title":{"rendered":"QuickBox2D Custom Debug Draw"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nimport com.actionsnippet.qbox.*;\r\nimport Box2D.Dynamics.*\r\n\r\nstage.frameRate = 60;\r\n\r\nvar sim:QuickBox2D = new QuickBox2D(this, {debug:true});\r\n\r\n\/\/ get at the b2DebugDraw instance\r\nvar debug:b2DebugDraw = sim.w.m_debugDraw;\r\ndebug.m_drawScale = 30.0;\r\ndebug.m_fillAlpha = 0.5;\r\ndebug.m_alpha = 0.5;\r\ndebug.m_lineThickness = 1.0;\r\ndebug.m_drawFlags = 0xFF;\r\n\r\nsim.createStageWalls();  \r\n\r\nfor (var i:int = 0; i&lt;10; i++){\r\n  sim.addBox({x:3 + i, y:3 + i, width:2, height:0.5});\r\n}\r\nsim.addCircle({x:12, y:5, radius:2});\r\n\r\nsim.start();\r\nsim.mouseDrag();\r\n<\/pre>\n<p><i>Note: This snippet requires the <a href=\"https:\/\/actionsnippet.com\/?page_id=1391\" target=\"blank\">QuickBox2D<\/a> library<\/i><\/p>\n<p>This snippet shows an easy way to get at the settings for Box2D&#8217;s debug renderer. <\/p>\n<p><a data-asruffle-linked=\"true\" href=\"http:\/\/www.actionsnippet.com\/swfs\/debug_draw.html\" target=\"blank\"><br \/>\nHave a look at the swf&#8230;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/debg_draw.gif\" \/><\/a> <span class=\"asruffle-link\" data-swf=\"{&quot;url&quot;:&quot;https:\\\/\\\/actionsnippet.com\\\/swfs\\\/debug_draw.swf&quot;,&quot;title&quot;:&quot;debug draw&quot;,&quot;width&quot;:800,&quot;height&quot;:600,&quot;missing&quot;:false,&quot;allowScriptAccess&quot;:false,&quot;backgroundColor&quot;:&quot;#ffffff&quot;}\"><button type=\"button\" hidden aria-expanded=\"false\">Play demo<span class=\"screen-reader-text\">: debug draw<\/span><\/button><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>import com.actionsnippet.qbox.*; import Box2D.Dynamics.* stage.frameRate = 60; var sim:QuickBox2D = new QuickBox2D(this, {debug:true}); \/\/ get at the b2DebugDraw instance var debug:b2DebugDraw = sim.w.m_debugDraw; debug.m_drawScale = 30.0; debug.m_fillAlpha = 0.5; debug.m_alpha = 0.5; debug.m_lineThickness = 1.0; debug.m_drawFlags = 0xFF; sim.createStageWalls(); for (var i:int = 0; i&lt;10; i++){ sim.addBox({x:3 + i, y:3 + i, width:2, height:0.5}); } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,14,15,4,16],"class_list":["post-441","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-actionscript","tag-as3","tag-box2d","tag-flash","tag-quickbox2d"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=441"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/441\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}