BBGamelib.CGAffineTransform.Make C# (CSharp) Method

Make() public static method

public static Make ( float a, float b, float c, float d, float tx, float ty ) : CGAffineTransform
a float
b float
c float
d float
tx float
ty float
return CGAffineTransform
		public static CGAffineTransform Make(float a, float b, float c, float d, float tx, float ty){
			CGAffineTransform t;
			t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
			return t;
		}
		public static CGAffineTransform MakeTranslation(float tx, float ty){

Usage Example

        // ------------------------------------------------------------------------------
        //  #region  CCNode Transform
        // ------------------------------------------------------------------------------

        /** Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
         * The matrix is in Pixels.
         * @since v0.7.1
         */
        public virtual CGAffineTransform nodeToParentTransform()
        {
            if (_isTransformDirty)
            {
                // Translate values
                float x = _position.x;
                float y = _position.y;

                if (_ignoreAnchorPointForPosition)
                {
                    x += _anchorPointInPixels.x;
                    y += _anchorPointInPixels.y;
                }

                // Rotation values
                // Change rotation code to handle X and Y
                // If we skew with the exact same value for both x and y then we're simply just rotating
                float cx = 1, sx = 0, cy = 1, sy = 0;
                if (!FloatUtils.EQ(_rotation, 0))
                {
                    float radiansX = -ccUtils.CC_DEGREES_TO_RADIANS(_rotation);
                    float radiansY = -ccUtils.CC_DEGREES_TO_RADIANS(_rotation);
                    cx = Mathf.Cos(radiansX);
                    sx = Mathf.Sin(radiansX);
                    cy = Mathf.Cos(radiansY);
                    sy = Mathf.Sin(radiansY);
                }

                // optimization:
                // inline anchor point calculation if skew is not needed
                // Adjusted transform calculation for rotational skew
                if (_anchorPointInPixels != Vector2.zero)
                {
                    x += cy * -_anchorPointInPixels.x * _scaleX + -sx * -_anchorPointInPixels.y * _scaleY;
                    y += sy * -_anchorPointInPixels.x * _scaleX + cx * -_anchorPointInPixels.y * _scaleY;
                }


                // Build Transform Matrix
                // Adjusted transfor m calculation for rotational skew
                _transform = CGAffineTransform.Make(cy * _scaleX, sy * _scaleX,
                                                    -sx * _scaleY, cx * _scaleY,
                                                    x, y);

                _isTransformDirty = false;
            }

            return(_transform);
        }