I am facing a real nightmare.
I have many Assets which use strange origin points.
I need to essentially draw these assets to a BitmapData, but the origin point causes all kinds of problems.
StackOVerflow does not let me attach an image so I will try to describe.
Imagine you have the shape of a digit "8".
You have 3 of these shapes.... Each shape has a different origin:
The middle of the "8" shape
The centre of the top "o" part of the "8" shape
The centre of the bottom "o" part of the "8" shape
How, with a single drawing routine, can I correctly draw each of these instances to a BitmapData?
Ideally I want to find the top left part of any Sprite bounding box, and bitmapdata.draw() from there.
But after 2 days, all of my attempts either get clipped.... or using matrices, they do not work for every origin point and different drawings get clipped in different locations.
Use getBounds or getRect, using the sprite itself as context.
var bounds:Rectangle = sprite.getBounds(sprite);
There is an issue when doing this with scaled objects though.