{"id":133,"date":"2008-12-24T00:00:26","date_gmt":"2008-12-24T07:00:26","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=414"},"modified":"2008-12-24T00:00:26","modified_gmt":"2008-12-24T07:00:26","slug":"bitmapdata-brush","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=133","title":{"rendered":"BitmapData Brush"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar canvas:BitmapData=new BitmapData(400,400,true,0xFFCCCCCC);\r\naddChild(new Bitmap(canvas));\r\n\r\nvar redOval:Shape = new Shape();\r\nwith(redOval.graphics) lineStyle(0,0), beginFill(0xFF0000), drawEllipse(0,0,10,50);\r\n\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\r\n\tredOval.x = mouseX;\r\n\tredOval.y = mouseY;\r\n\tredOval.rotation += 10\r\n\t\/\/ transform.matrix contains all transformation information for \r\n\t\/\/ the redOval including scaleX, scaleY, x, y, rotation etc...\r\n\tcanvas.draw(redOval, redOval.transform.matrix);\r\n}\r\n<\/pre>\n<p>A very easy way to create a BitmapData brush.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>var canvas:BitmapData=new BitmapData(400,400,true,0xFFCCCCCC); addChild(new Bitmap(canvas)); var redOval:Shape = new Shape(); with(redOval.graphics) lineStyle(0,0), beginFill(0xFF0000), drawEllipse(0,0,10,50); addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { redOval.x = mouseX; redOval.y = mouseY; redOval.rotation += 10 \/\/ transform.matrix contains all transformation information for \/\/ the redOval including scaleX, scaleY, x, y, rotation etc&#8230; canvas.draw(redOval, redOval.transform.matrix); } A very easy way to create a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[3,4],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-bitmapdata","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/133","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=133"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}