{"author_name":"MrPhil","cat":"LD #23","comments":[],"epoch":1334958660,"likes":1,"metadata":{"p_key":"58602","p_author":"MrPhil","p_authorkey":"165","p_urlkey":"94351","p_title":"Desk Shot + Code","p_cat":"LD #23","p_event":"LD23","p_time":"1334958660","p_likes":"1","p_comments":"0","p_status":"UPD5","us_key":"165","us_name":"MrPhil","us_username":"mrphil","event_start":"1334880000","event_key":"10","event_name":"LD23"},"text":"<p>Here&#8217;s the command center, that&#8217;s right I code in a storage closet and that&#8217;s my cat Jack. \u00a0His hobby is to keep me from using the keyboard\u00a0or mouse.<\/p>\n <div style=\"width: 601px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mrphilgames.files.wordpress.com\/2012\/04\/dscf1235.jpg\"><img class=\"   \" src=\"http:\/\/mrphilgames.files.wordpress.com\/2012\/04\/dscf1235.jpg\" alt=\"Mr. Phil Games Earth Headquarters\" width=\"591\" height=\"788\" \/><\/a><p class=\"wp-caption-text\">Mr. Phil Games Earth Headquarters<\/p><\/div>\n <p>I also wanted to share this snippet of AS3 code that lets you choose a color and then convert pixels of that color to transparent pixels:<\/p>\n <blockquote><p>public static function MakeTransparent(source:*, color:uint = 0x00FF00FF) : BitmapData<br \/>\n {<br \/>\n \/\/ Get the bitmap data so we can fix it<br \/>\n var bitmapData:BitmapData<br \/>\n if (source is Class)<br \/>\n bitmapData = FP.getBitmap(source);<br \/>\n else if (source is BitmapData)<br \/>\n bitmapData = source;<\/p>\n <p>\/\/ We aren&#8217;t use the transparent feature, hence the color<br \/>\n var bitmapDataNew:BitmapData = new BitmapData(bitmapData.width,<br \/>\n bitmapData.height, true, 0x00000000);<br \/>\n var pt:Point = new Point(0, 0);<br \/>\n var rect:Rectangle = new Rectangle(0, 0, bitmapData.width,<br \/>\n bitmapData.height);<br \/>\n var transparent:uint = 0x00000000;<br \/>\n var maskColor:uint = 0x00FFFFFF;<br \/>\n bitmapDataNew.threshold(bitmapData, rect, pt, &#8220;==&#8221;, color, transparent, maskColor, true);<\/p>\n <p>return bitmapDataNew;<br \/>\n }<\/p><\/blockquote>\n <p>&nbsp;<\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/cat\/\" rel=\"tag\">cat<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/code\/\" rel=\"tag\">code<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/codebase\/\" rel=\"tag\">codebase<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/desk\/\" rel=\"tag\">desk<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/deskphoto\/\" rel=\"tag\">deskphoto<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/flashpunk\/\" rel=\"tag\">flashpunk<\/a><\/p>","time":"April 20th, 2012 4:51 pm","title":"Desk Shot + Code"}