{"id":327,"date":"2009-06-26T05:02:57","date_gmt":"2009-06-26T12:02:57","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1634"},"modified":"2009-06-26T05:02:57","modified_gmt":"2009-06-26T12:02:57","slug":"quickbox2d-skinning","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=327","title":{"rendered":"QuickBox2D Skinning"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nimport com.actionsnippet.qbox.*;\r\n\r\nvar sim:QuickBox2D = new QuickBox2D(this);\r\n\r\nsim.createStageWalls({lineAlpha:0,fillColor:0x000000})\r\nsim.addBox({x:3, y:3, width:3, height:3, skin:BoxSkin});\r\nsim.addCircle({x:3, y:8,radius:1.5,  skin:CircleSkin});\r\nsim.addPoly({x:6, y:3, verts:&#x5B;&#x5B;1.5,0,3,3,0,3,1.5,0]], skin:TriangleSkin});\r\n\r\nsim.addBox({x:6, y:3, width:3, height:3, skin:BoxSkin});\r\nsim.addCircle({x:6, y:8,radius:1.5,  skin:CircleSkin});\r\nsim.addPoly({x:12, y:3, verts:&#x5B;&#x5B;1.5,0,3,3,0,3,1.5,0]], skin:TriangleSkin});\r\n\r\nsim.start();\r\nsim.mouseDrag();\r\n<\/pre>\n<p>You&#8217;ll <a href=\"http:\/\/www.actionsnippet.com\/swfs\/skindemo.fla\">need this fla<\/a> to run this snippet since the graphics are in the library. This snippet shows how to easily use linkage classes as the graphics for your rigid bodies. This was actually one of the first features I implemented in <a href=\"https:\/\/actionsnippet.com\/?page_id=1391\" target=\"blank\">QuickBox2D<\/a>.<\/p>\n<p><a data-asruffle-linked=\"true\" href=\"https:\/\/actionsnippet.com\/swfs\/skindemo.html\" target=\"blank\"><br \/>\nTake a look at the swf here&#8230;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/qb2d_skin.gif\" \/><\/a> <span class=\"asruffle-link\" data-swf=\"{&quot;url&quot;:&quot;https:\\\/\\\/actionsnippet.com\\\/swfs\\\/skindemo.swf&quot;,&quot;title&quot;:&quot;skindemo&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\">: skindemo<\/span><\/button><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>import com.actionsnippet.qbox.*; var sim:QuickBox2D = new QuickBox2D(this); sim.createStageWalls({lineAlpha:0,fillColor:0x000000}) sim.addBox({x:3, y:3, width:3, height:3, skin:BoxSkin}); sim.addCircle({x:3, y:8,radius:1.5, skin:CircleSkin}); sim.addPoly({x:6, y:3, verts:&#x5B;&#x5B;1.5,0,3,3,0,3,1.5,0]], skin:TriangleSkin}); sim.addBox({x:6, y:3, width:3, height:3, skin:BoxSkin}); sim.addCircle({x:6, y:8,radius:1.5, skin:CircleSkin}); sim.addPoly({x:12, y:3, verts:&#x5B;&#x5B;1.5,0,3,3,0,3,1.5,0]], skin:TriangleSkin}); sim.start(); sim.mouseDrag(); You&#8217;ll need this fla to run this snippet since the graphics are in the library. This snippet shows how to easily [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13,22,12],"tags":[3,14,15,4,16],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-box2d","category-motion","category-movieclip","category-quickbox2d","tag-actionscript","tag-as3","tag-box2d","tag-flash","tag-quickbox2d"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/327","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=327"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}