{"author_name":"refrag","cat":"LD #16 - Exploration - 2009","comments":[],"epoch":1260592860,"likes":0,"metadata":{"p_key":"72219","p_author":"refrag","p_authorkey":"1277","p_urlkey":"108041","p_title":"Fun with Alpha Masks in Flash","p_cat":"LD #16 - Exploration - 2009","p_event":"LD16","p_time":"1260592860","p_likes":"0","p_comments":"0","p_status":"UPD5","us_key":"1277","us_name":"refrag","us_username":"refrag","event_start":"1260489600","event_key":"2","event_name":"LD16"},"text":"<p>I was able to think of a very rough game idea on the walk home so I started sketching some ideas on paper. I knew that I&#8217;d need to get Alpha Masking working in Flash to make my idea work. I&#8217;d never done Alpha masking in Flash so I started to prove out this tech.<\/p>\n <p><strong>Build 001<\/strong> took a couple of hours to get working. Note to everyone wanting to do Alpha Masking in Flash&#8230; .cacheToBitmap is the trick. Do this on the target Bitmap you want to mask, as well as on the Sprite you are using as the mask object.<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.26-PM.png\"><img class=\"alignnone size-medium wp-image-11988\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.26-PM-300x260.png\" alt=\"Build 001\" width=\"300\" height=\"260\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.26-PM-300x260.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.26-PM-550x477.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n <p>For <strong>Build 002 <\/strong>I decided to try and hack together some of my old tile engine code. This again took longer than anticipated mostly because I was copy and pasting from wrong directories. Doh. Anyway, an hour or so later and I had this working. You are seeing a tile layer being masked by a sprite that has alpha blobs moving through it. The hero object is not affected by the masking because she exists in a separate object.<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.34-PM.png\"><img class=\"alignnone size-medium wp-image-11992\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.34-PM-300x260.png\" alt=\"Build002\" width=\"300\" height=\"260\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.34-PM-300x260.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/12\/Screen-shot-2009-12-11-at-10.34.34-PM-550x477.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n <p>I&#8217;ll muck around for another hour or so tonight before I rest up for tomorrow.<\/p>","time":"December 11th, 2009 11:41 pm","title":"Fun with Alpha Masks in Flash"}