A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Draw() matrix.Scale, matrix.Translate, Help!

Threaded View

  1. #1
    Member
    Join Date
    Jan 2009
    Location
    Texas
    Posts
    75

    [Resolved] Draw() matrix.Scale, matrix.Translate, Help!

    This works! ENJOY!

    Code:
    MyDraw(srcbmpdata,dx,dy,width,height,scalex,scaley ,dstbmpdata)
    {
    var trans:Matrix = new Matrix();
    trans.translate(-(width/2), -(height/2));
    trans.scale(scalex, scaley); 
    trans.translate(width/2, height/2);
    trans.translate(dx-(width/2), dy-(height/2));
    dstbmpdata.draw(srcbmpdata, trans, null,null,null,true);		
    }
    Last edited by as3newb; 02-03-2009 at 06:27 PM. Reason: Resolved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center