Topic: Game Programming /
AS2 copypixels() and draw()
Ok, well I got this to work myself in the end. Because a couple of other people expressed interest when i first mentioned it I thought I’d share my method.
First, set up the thing that you’re going to draw onto:
var groundbmps:BitmapData = new BitmapData(640, 480, true,0×000000);
This attaches a (640 by 480 in this case) transparent drawing area to the ‘groundmc’ which is what i wanted to draw on.
Then when you want to draw a movieclip, examplemc, onto it simply go
var myMatrix:Matrix = new Matrix();
var translateMatrix:Matrix = new Matrix();
That will then draw examplemc on the groundmc (-this assumes that the origin for groundmc and examplemc are the same i think…) and remove examplemc.
Its working perfectly in my game now, so any errors are down to typinig that up, but if anyone has any questions/advice that would be great.