Proposal: Tilemap changes

Tracking here:

here’s the code i’ve used for rotating tiles in a recent project, i think it originally came from further up this thread… x and y are the position you want you pivot point to be located at. pivotX and pivotY are the rotational origin point within the tile. If you’re rotating by a centre point (which i wasn’t in this case), for example, you would need to set: pivotX = Math.floor(twidth/2); pivotY = Math.floor(theight/2); (where twidth and theight are your tile width and height !)

public function setrotation(rot:Float) { //rotation in radians

	mat = tile.matrix;

	mat.a = Math.cos(rot);
	mat.c = Math.sin(rot);
	mat.b = - mat.c;
	mat.d = mat.a;

	tile.x = x  - (pivotX * mat.a) - (pivotY * mat.c);
	tile.y = y  - (pivotX * mat.b) - (pivotY * mat.d);

}