Nez.Portable/UI/Base/Group.cs
/// <summary>
/// Returns the transform for this group's coordinate system
/// </summary>
/// <returns>The transform.</returns>
Returns the transform for this group's coordinate system
Returns the transform for this group ' s coordinate system
protected Matrix2D computeTransform()
        {
            var mat = Matrix2D.identity;
            if (originX != 0 || originY != 0)
                mat = Matrix2D.multiply(mat, Matrix2D.createTranslation(-originX, -originY));
            if (rotation != 0)
                mat = Matrix2D.multiply(mat, Matrix2D.createRotation(MathHelper.ToRadians(rotation)));
            if (scaleX != 1 || scaleY != 1)
                mat = Matrix2D.multiply(mat, Matrix2D.createScale(scaleX, scaleY));
            mat = Matrix2D.multiply(mat, Matrix2D.createTranslation(x + originX, y + originY));
            Group parentGroup = parent;
            while (parentGroup != null)
            {
                if (parentGroup.transform)
                    break;
                parentGroup = parentGroup.parent;
            }
            if (parentGroup != null)
                mat = Matrix2D.multiply(mat, parentGroup.computeTransform());
            return mat;
        }
protected Matrix2D computeTransform ( ) { var mat = Matrix2D . identity ; if ( originX != 0 || originY != 0 ) mat = Matrix2D . multiply ( mat , Matrix2D . createTranslation ( - originX , - originY ) ) ; if ( rotation != 0 ) mat = Matrix2D . multiply ( mat , Matrix2D . createRotation ( MathHelper . ToRadians ( rotation ) ) ) ; if ( scaleX != 1 || scaleY != 1 ) mat = Matrix2D . multiply ( mat , Matrix2D . createScale ( scaleX , scaleY ) ) ; mat = Matrix2D . multiply ( mat , Matrix2D . createTranslation ( x + originX , y + originY ) ) ; Group parentGroup = parent ; while ( parentGroup != null ) { if ( parentGroup . transform ) break ; parentGroup = parentGroup . parent ; } if ( parentGroup != null ) mat = Matrix2D . multiply ( mat , parentGroup . computeTransform ( ) ) ; return mat ; }
Returns the transform for this group's coordinate system
Returns the transform for this group ' s coordinate system
// Find the first parent that transforms
None