Open ramachandran-prazas opened 9 years ago
You can get this from the Sprite local matrix using mySprite.getLocalMatrix()
. I wrote a utilty class to grab the rotation out of it.
import flambe.math.Matrix;
/**
* Utility mixins for Matrix. Designed to be imported with 'using'.
* @author Mark Knol
*/
class MatrixUtils
{
inline public static function getX(matrix:Matrix):Float
{
return matrix.m02;
}
inline public static function getY(matrix:Matrix):Float
{
return matrix.m12;
}
inline public static function getScaleX(matrix:Matrix):Float
{
return Math.sqrt(matrix.m00 * matrix.m00 + matrix.m01 * matrix.m01);
}
inline public static function getScaleY(matrix:Matrix):Float
{
return Math.sqrt(matrix.m10 * matrix.m10 + matrix.m11 * matrix.m11);
}
inline public static function getRotation(matrix:Matrix):Float
{
return Math.atan(-matrix.m01 / matrix.m00);
}
}
Is there a way to get the sprite value as it is from a particular frame of Movie (flump exported).
For example if i have a animation where rotation of a balloon is changing, and I want the contents of a particular frame along with its rotation applied instead of the original symbol image.
Thanks.