Copy link to clipboard
Copied
I have this image load :
This is a square and I would like to transform it like this :
Using the Matrix class. This is a parallelogram, not a rhombus, because the width is 100px and the height is 53px.
I have already done this :
var bmp:Bitmap = new Main.Grass();
addChild(bmp);
bmp.x = (stage.stageWidth - bmp.width) / 2;
bmp.y = (stage.stageHeight - bmp.height) / 2;
Copy link to clipboard
Copied
bmp.transform.matrix=new Matrix(1,0,-1,1,(stage.stageWidth-bmp.width)/2,(stage.stageHeight-bmp.height)/2);
Copy link to clipboard
Copied
This is not the exact figure what I wish and I don't see how to use the Matrix class properly
Copy link to clipboard
Copied
if your rectangles reg point is top-left, that should be pretty close.
i showed how to use the matrix class: for skewing, the 2nd parameter adjusts the y properties and the 3rd parameter adjusts the x properties.
from the look of your parallelogram, it appears you want to adjust the x property only.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now