Exemple #1
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Rotates the target around the specified local position from the specified angle to its current angle.
        /// </summary>
        /// <param name="localPoint"></param>
        /// <param name="angle"></param>
        /// <returns></returns>
        public Tween TransformAroundPointFrom(Vector3 localPoint, float angle)
        {
            Transform      t = GetTransform("transformAroundPointFrom");
            TweenTransform p = new TweenTransform(t);

            p.Rotate(t.localRotation.z, angle);
            p.TransformAroundPoint(localPoint);
            _procedures.Add(p);
            return(this);
        }
Exemple #2
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Scales the target around the specified local position from the specified scale values to its current scale values.
        /// </summary>
        /// <param name="localPoint"></param>
        /// <param name="scaleX"></param>
        /// <param name="scaleY"></param>
        /// <returns></returns>
        public Tween TransformAroundPointFrom(Vector3 localPoint, float scaleX, float scaleY)
        {
            Transform      t = GetTransform("transformAroundPointFrom");
            TweenTransform p = new TweenTransform(t);

            p.Scale(t.localScale.x, t.localScale.y, scaleX, scaleY);
            p.TransformAroundPoint(localPoint);
            _procedures.Add(p);

            return(this);
        }
Exemple #3
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Scales and rotates the target around the specified local position.
        /// </summary>
        /// <param name="localPoint"></param>
        /// <param name="angle"></param>
        /// <param name="scaleX"></param>
        /// <param name="scaleY"></param>
        /// <returns></returns>
        public Tween TransformAroundPoint(Vector3 localPoint, float angle, float scaleX, float scaleY)
        {
            Transform      t = GetTransform("transformAroundPoint");
            TweenTransform p = new TweenTransform(t);

            p.Rotate(t.localRotation.z, angle);
            p.Scale(t.localScale.x, t.localScale.y, scaleX, scaleY);
            p.TransformAroundPoint(localPoint);
            _procedures.Add(p);

            return(this);
        }
Exemple #4
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Rotates the specified target from the specified rotation to its current rotation.
        /// </summary>
        /// <param name="rotation"></param>
        /// <returns></returns>
        public Tween RotateFrom(float rotation)
        {
            Transform t = GetTransform();

            if (t != null)
            {
                TweenTransform p = new TweenTransform(t);
                p.Rotate(rotation, t.localEulerAngles.z);
                _procedures.Add(p);
            }
            else
            {
                From("rotation", rotation);
            }
            return(this);
        }
Exemple #5
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Scales the target from the specified scale value to its current scale value.
        /// </summary>
        /// <param name="scaleX"></param>
        /// <param name="scaleY"></param>
        /// <returns></returns>
        public Tween ScaleFrom(float scaleX, float scaleY)
        {
            Transform t = GetTransform();

            if (t != null)
            {
                TweenTransform p = new TweenTransform(t);
                p.Scale(scaleX, scaleY, t.localScale.x, t.localScale.y);
                _procedures.Add(p);
            }
            else
            {
                From("scaleX", scaleX);
                From("scaleY", scaleY);
            }
            return(this);
        }
Exemple #6
0
        // -------------------------------------------------------------------------------------------
        /// <summary>
        /// Moves the target from the specified position to its current position.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public Tween MoveFrom(float x, float y)
        {
            Transform t = GetTransform();

            if (t != null)
            {
                TweenTransform p          = new TweenTransform(t);
                Vector3        currentPos = TweenFuncs.GetLocalPosition(t);
                p.Move(x, y, currentPos.x, currentPos.y);
                _procedures.Add(p);
            }
            else
            {
                From("x", x);
                From("y", y);
            }
            return(this);
        }