About | Rules and Guide | Sign In/Create Account | Write a Post
Construction1990’s Internet Montage? No!
Please excuse the site weirdness. Mike is fixing and making things.
Ludum Dare 31 — Coming December 5th-8th 2014!

  • ??? Begins: in 7 days, 21 hours, 30 minutes, 38 seconds
  • October Ends: in 8 days, 21 hours, 42 minutes, 38 seconds
  • Ludum Dare 31 begins: in 43 days, 22 hours, 30 minutes, 38 seconds
  • (FYI: Clock might be off) | Ludum Dare 31: Real World Gatherings (Now Open!)

    [ October Challenge 2014 | Resources | Submit/Edit | View All ]


    Desk Shot + Code

    Posted by (twitter: @xMrPhil)
    April 20th, 2012 4:51 pm

    Here’s the command center, that’s right I code in a storage closet and that’s my cat Jack. ¬†His hobby is to keep me from using the keyboard¬†or mouse.

    Mr. Phil Games Earth Headquarters

    Mr. Phil Games Earth Headquarters

    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:

    public static function MakeTransparent(source:*, color:uint = 0x00FF00FF) : BitmapData
    {
    // Get the bitmap data so we can fix it
    var bitmapData:BitmapData
    if (source is Class)
    bitmapData = FP.getBitmap(source);
    else if (source is BitmapData)
    bitmapData = source;

    // We aren’t use the transparent feature, hence the color
    var bitmapDataNew:BitmapData = new BitmapData(bitmapData.width,
    bitmapData.height, true, 0x00000000);
    var pt:Point = new Point(0, 0);
    var rect:Rectangle = new Rectangle(0, 0, bitmapData.width,
    bitmapData.height);
    var transparent:uint = 0x00000000;
    var maskColor:uint = 0x00FFFFFF;
    bitmapDataNew.threshold(bitmapData, rect, pt, “==”, color, transparent, maskColor, true);

    return bitmapDataNew;
    }

     

    Tags: , , , , ,

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]